express-rest-admin
v0.5.2
Published
REST-ADMIN server-side based on Express@next and Mongoose
Downloads
11
Maintainers
Readme
Express REST-ADMIN
REST-ADMIN server-side based on Express@next and Mongoose
Usage
Please make sure to follow the guide of REST-ADMIN
- Install:
npm i express-rest-admin
app.use('/admin/api', require('express-rest-admin')())
- Now you got all apis for REST-ADMIN.
Options
Use: require('express-rest-admin')(options)
{
secret: 'a random string', // used for jwt signing
auth: {
modelName: 'User', // which model to use for login
allowGuest: true, // allow guests access
username: 'username', // `username` field
password: 'password', // `password` field
where: {} // additional query
},
site: {}, // rest admin site config
middleware: {
query: {
name: 'query' // req.query.query
},
resource: {
name: 'resource' //req.params.resource
},
},
router: {
prefix: '/' // restful apis prefix
},
controllers: {} // override default controllers
}