route-now

0.0.5 • Public • Published

Express inspired ultra fast and minimalist router for serverless functions. Uses trouter and qs

Note: The api is still in flux. I would not use this library yet.

    const Router = require('route-now')
    const app = Router()
    app.use(authenticate)
    app.get('/', handle)
    app.post('/', handle)
    app.put('/', handle)
    app.delete('/', handle)
 
    module.exports = app.handler
 
    function authenticate(req, res) {
        if (!auth) throw({statusCode: 401})
    }
 
    function handle(req, res) {
        res.json({foo: 'bar'})
    }

Readme

Keywords

none

Package Sidebar

Install

npm i route-now

Weekly Downloads

8

Version

0.0.5

License

ISC

Unpacked Size

2.18 kB

Total Files

4

Last publish

Collaborators

  • esundahl