nexxusjs

1.0.0 • Public • Published

nexxusjs

npm package

NPM Version NPM Downloads Maintenance

Known Vulnerabilities GitHub issues GitHub forks GitHub stars

Why

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.

How to use

yarn add nexxusjs
or
npm install --save nexxusjs

Simple express server create.

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()

License

npm

Package Sidebar

Install

npm i nexxusjs

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

9.19 kB

Total Files

8

Last publish

Collaborators

  • andreoneti