0.4.4 • Published 4 years ago

octoris v0.4.4

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

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!

0.4.4

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago