Add api for grouping routes in Felid.
npm install felid-group
or
yarn add felid-group
const Felid = require('felid')
const group = require('felid-group')
const app = new Felid()
app.plugin(group, options)
const api = app.group('/api')
// /api/get
api.get('/get', (req, res) => {
res.send('test')
}))
// /api/post
api.post('/post', (req, res) => {
res.send('test')
}))
// make nested routing group: /api/v1/get
api.group('/v1').get('/get', (req, res) => {
res.send('test')
}))
- decorator Object: Customize the decorator names. Default is:
{
group: 'group'
}
- felid.group(prefix: String) => Object