Enhancing urls for express.js.
URLS.JS
With this module you can name used urls and call them by name in the template.
Install
urls = ;
Set urls:
Set urls like you set them without this module
;
*You have to pass the 'app' object so urls.js can move the urls and create dinamic helper.
Use in templates
Use url names in templates (jade example)
p url from urlsjs module #
If you are using handlebars the HTML code will look something like:
<p> <a href="{{ url 'index' }}">home page</a></p>
You can send params like this (user:id):
<p> <a href="{{ url 'users/' }}0035262">aleksansrenko</a></p>