This library is designed to speed server creation and define routes. But I need everyone's contribution to improve the library and grow fast and optimized.
Open a lot of tasks if necessary to improve this. I count on the collaboration of all.
yarn add nexxusjs
or
npm install --save nexxusjs
The server uses by default, cors released to everyone, morgan with 'dev' option and helmet
const nexxusjs = require('nexxusjs');
const default = require('./default/router');
const defaultPostRoute = require('./defaultPostRoute');
new nexxusjs()
.setPort(3000)
.setMiddleware(function (req, res, next) {
console.log("My middleware logic here");
next();
})
.setMasterRout('/api')
.setRoute('/1', default)
.setRouteWithMiddleware('/2', default, function (req, res, next) {
console.log("Middleware logic here");
next();
})
.createRoute('get', 'test', (req, res, next) => {
res.status(200).send("Work").end();
})
.createRoute('post', '/test', defaultPostRoute)
.run()