@fizz.js/node-controller
v1.0.0
Published
node-controller
Downloads
1
Readme
@fizz.js/node-controller
This is a Controller library for express.
install
add dependencies
into package.json
and run yarn install
test
yarn test
coverage
yarn cover
build
yarn build
docs
yarn docs
example
const fs = require('fs')
const path = require('path')
const inflector = require('inflected')
const Controller = require('@fizz.js/node-controller')
const basename = path.basename(__filename)
const ext = '.js'
fs.readdirSync(__dirname)
.filter(file => file.indexOf('.') !== 0 && file !== basename && file.slice(-3) === ext)
.map(file => file.replace(ext, ''))
.map(file => Controller.register(file, require(`./${file}`)))