hapi-recall
v0.0.1
Published
Interpret route format for `hapi` and provide a way to construct a formatted route
Downloads
1
Readme
hapi-recall
hapi's router module, call, parses a path and extract the params from a matching path. This module does the inverse: given a hapi
path and a query object representing the path params, return a formatted path
To use
var hapiRecall = require('hapi-recall');
hapiRecall('/{foo}', {foo:'bar'}); // => '/bar'
hapiRecall('/{foo}/literal/{buzz}', {foo:'bar',buzz:'bee'}); // => '/bar/literal/bee'