.route(path, options)
path
{String} - Path with placeholdersoptions
{Object}options.name
{String} - Route's nameoptions[prop-name]
{Any} - [Optional] Any property which will be available inside route calloptions[hook-name]
{Function} - [Optional] See all available hooks- Returns {Route}
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
FlowRouter.route('/blog/:cat/:id', {
name: 'blogPostRoute'
})
const params = {cat: "meteor", id: "abc"};
const queryParams = {show: "yes", color: "black"};
const path = FlowRouter.path("blogPostRoute", params, queryParams);
console.log(path); // prints "/blog/meteor/abc?show=yes&color=black"
// Create 404 route (catch-all)
FlowRouter.route('*', {
action() {
// Show 404 error page
}
});