Skip to content

📡 A simple node server module, in less than 120 lines, compatible to expressjs middlewares

License

Notifications You must be signed in to change notification settings

amazingandyyy/node-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📡 node-server

A simple node server module.

compatible to express middleware!

zero dependencies

Installation

$ npm i --save @amazingandyyy/node-server
# or
$ yarn add @amazingandyyy/node-server

Usage

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

License

MIT

About

📡 A simple node server module, in less than 120 lines, compatible to expressjs middlewares

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published