Skip to content

Instantly share code, notes, and snippets.

@NoumanSaleem
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NoumanSaleem/782c00d8aa4121adf6c3 to your computer and use it in GitHub Desktop.
Save NoumanSaleem/782c00d8aa4121adf6c3 to your computer and use it in GitHub Desktop.
{
"profile": "/user/:id(\\d+)",
"profileComment": "/user/:id(\\d+)/comments/:commentId(\\d+)"
}
var routes = require('routes');
var link = require('link');
link(routes.profile, { id: 123 }); // /user/123
link(routes.profileComment, { id: 123, commentId: 321 }) // /user/123/comments/321
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment