call - Simple HTTP Router
Introduction
call
is a simple node.js HTTP Router. It is used by popular hapi.js web framework. It implements predictable and easy to use routing. Even if it is designed to work with Hapi.js, you can still use it as an independent router in your app.
Example
const Call = require('call');
const router = new Call.Router();
router.add({ method: 'get', path: '/' }, { label: 'root-path' });
router.add({ method: 'post', path: '/users' }, 'route specific data');
router.add({ method: 'put', path: '/users/{userId}' }, () => { });
router.route('post', '/users');
router.route('put', '/users/1234');
API
See the detailed API Reference.