Flyn
Flyn is a multi framework package that makes easier to create routes for controllers.
Install
- Use:
require('flyn')
- Install:
npm install --save flyn
- Use:
require('flyn')
- Install:
yarn add flyn
Usage
Example
const app = require('express')()
flyn({
path: './routes',
logger: true,
prefix: ''
})(app)
app.listen(process.env.PORT, () => {
console.log(
'Server running on',
process.env.PORT
)
})
Endpoint file example
module.exports = app => (req, res) => {
return res.send({
success: 1
})
}
Another endpoint file example
module.exports = app => (req, res) => {
console.log('User created with success')
return res.send({
success: 1
})
}
Compatibility
Now
Soon
License
Licensed under permissive MIT license