Give a route a name and one or more exact paths.
module.exports = {
name: 'about',
paths: ['/about', '/about-us'],
handler: function (state) {
return 'About us'
}
}
state.link('about') returns /about. Paths match exactly; :id has no special meaning. Use query parameters for values and localized routes for languages.
Next: Methods →