A small and simple node server framework.
npm i octoris
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])
You can find the documentation here
Here is a list of official released middleware for Octoris
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!