1.0.0 • Published 4 years ago

@fizz.js/node-controller v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

@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}`)))