Kayser
Async HTTP framework for Node
Installation
yarn add kayser
Or, if you prefer to use npm
:
npm install --save kayser
Usage
In your package.json
:
{
"scripts": {
+ "start": "kayser"
}
}
Basic usage
In your index.js
(or the file in your main
field in package.json
):
module.exports = (req, res) => {
return {
message: 'hello world'
}
}
With routes
const { router, get } = require('kayser/http')
const routes = new Map()
get(routes, '/', (req, res) => ({ body: 'root route' }))
get(routes, '/about', (req, res) => ({ body: 'about route' }))
module.exports = router(routes)
Configuration
TBD.