Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amazingandyyy/node-server
📡 A simple node server module, in less than 120 lines, compatible to expressjs middlewares
https://github.com/amazingandyyy/node-server
express http http2 https koa nodejs opensource restful-api scratchese server
Last synced: 11 days ago
JSON representation
📡 A simple node server module, in less than 120 lines, compatible to expressjs middlewares
- Host: GitHub
- URL: https://github.com/amazingandyyy/node-server
- Owner: amazingandyyy
- License: mit
- Created: 2019-08-14T20:41:16.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-09T07:12:44.000Z (almost 4 years ago)
- Last Synced: 2024-10-12T18:51:08.245Z (26 days ago)
- Topics: express, http, http2, https, koa, nodejs, opensource, restful-api, scratchese, server
- Language: JavaScript
- Homepage:
- Size: 39.1 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
📡 node-server
A simple node server module.> compatible to express middleware!
> zero dependencies
## Installation
```shell
$ npm i --save @amazingandyyy/node-server
# or
$ yarn add @amazingandyyy/node-server
```## Usage
```javascript
const NodeServer = require('@amazingandyyy/node-server')
const bodyParser = require('@amazingandyyy/body-parser');
const morgan = require('morgan') // compatible to express middlewaresconst 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