octoris
v0.4.4
Published
A functional and friendly node http framework
Downloads
16
Maintainers
Readme
A small and simple node server framework.
Install
npm i octoris
Usage
Create a basic server:
const { listen } = require('octoris')
const routes = require('./routes')
listen({ port: 3000 }, routes)
.then(addr => console.log(`Server Listening on ${addr}`))
.catch(console.error)
routes.js:
const { router, response, methods } = require('octoris')
const { send } = response
const { route, fixed, composeRoutes } = router
const { GET } = methods
function homeHandler () {
return send(200, 'Hello Home!')
}
function aboutHandler () {
return send(200, 'Hello About!')
}
const home = route([fixed('home')], [
GET(homeHandler)
])
const about = route([fixed('about')], [
GET(aboutHandler)
])
module.exports = composeRoutes({ logger: true }, [about, home])
Documentation
You can find the documentation here
Official Middleware
Here is a list of official released middleware for Octoris
Contribute
Checkout the contribute file here
Please check this file regularly as it is Subject to change and updated as the project continues to develop and grow!