Mongoose Express Api
Flexible automatic API generation for Moongose and Express
Features
- Unobtrusive mix routes into Express apps.
- Quick setup.
- RESTful ready to use default implementation with
CRUDL
(create
,read
,update
,destroy
andlist
) actions and JSend responses.list
action supports complex queries through moongose-api-query. - Setup middlewares to secure api and intercept requests.
- Choose which models to map and actions enabled to them.
- Flexible Interface: you can change everything, modifing actions and response formats, or replace the whole implementation to use different protocols or action sets.
- Automatic documentation generation.
Installation
npm install mongoose-express-api
or specify it as a dependency in package.json
"dependencies": {
"mongoose-express-api": "*"
}
and then run npm install
in your project root.
Examples
Basic usage
MongooseExpressApi = ;api = ;api;api;
Filtering models
api
Specifying allowed actions
api
Adding a single model
api
Adding a single model filtering actions
api
Extending implementation
impl = api;impl;impl;
Replacing Implementation
impl = api;
Securing api and using middlewares
impl;impl;
Generate Documentation
api = title: "My API" description: "This API is for .." version: "1.0.0" ;api;api;api;