A simple node server module.
compatible to express middleware!
zero dependencies
$ npm i --save @amazingandyyy/node-server
# or
$ yarn add @amazingandyyy/node-server
const NodeServer = require('@amazingandyyy/node-server')
const bodyParser = require('@amazingandyyy/body-parser');
const morgan = require('morgan') // compatible to express middlewares
const app = new NodeServer()
app.use(morgan('dev'))
app.use(bodyParser)
app.get('/ping', (req, res)=>{
res.send('pong')
})
app.post('/register', (req, res)=>{
res.send(req.body)
})
app.start({ port: 4000 })
MIT