1.1.27 • Published 7 years ago

quail-rest v1.1.27

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Quail

Hassle free mongodb rest app

Features

  • Uses ACL (Access Control List) to better manage routes. So no route management.
  • Uses built in JWT Token Authentication.
  • Support for prevention of brute force attacks using express-brute
  • Uses sails like models and controllers
  • Blueprints to make life easy
  • Support for embeded documents to enable transactions

#Installation

npm install -g quail-cli

#Prerequisite A running instance of mongodb

#Getting Started

  1. Create a project by running the command
quail create <myapp>
  1. Change directory to your app and npm install
cd myapp && npm install
  1. Create a model
quail add-model user

OR

quail m user
  1. Create a controller
quail add-controller user

OR

quail c user
  1. Run the app
npm start

Quail supports sails like blueprints out of the box but is protected by ACL(access control list). Change your acl to allow the following actions find , findOne, create, update and destroy for the user controller

module.exports = {
    routes: {
        authenticated: {},
        not_authenticated: {
        	User:{
        		find: true,
        		findOne: true,
        		create: true,
        		update: true,
        		destroy: true,
        	}
        }
    }
}

Now restart the server and send a post request to http://localhost:3000/user with request body

*POST to http://localhost:3000/user
{
	name : 'Quail',
}

Get all the user by sending a get request to http://localhost:3000/user

*GET to http://localhost:3000/user

Get a particular user by sending a get request to http://localhost:3000/user/:id

*GET to http://localhost:3000/user/:id

Update a particular user by sending a put request to http://localhost:3000/user/:id

*PUT to http://localhost:3000/user/:id
{
	name:'Quail is awesome'
}

Destroy a particular user by sending a delete request to http://localhost:3000/user/:id

*DELETE to http://localhost:3000/user/:id
  • Docs coming soon
1.1.27

7 years ago

1.1.26

8 years ago

1.1.25

8 years ago

1.1.24

8 years ago

1.1.23

8 years ago

1.1.22

8 years ago

1.1.21

8 years ago

1.1.20

8 years ago

1.1.19

8 years ago

1.1.18

8 years ago

1.1.17

8 years ago

1.1.16

8 years ago

1.1.15

8 years ago

1.1.14

8 years ago

1.1.13

8 years ago

1.1.12

8 years ago

1.1.11

8 years ago

1.1.10

8 years ago

1.1.9

8 years ago

1.1.8

8 years ago

1.1.7

8 years ago

1.1.6

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago