Skip to content

Instantly share code, notes, and snippets.

@beeblebrox3
Created September 15, 2017 12:03
Show Gist options
  • Save beeblebrox3/3a9dc79b644aed1bbf0ea79159acd004 to your computer and use it in GitHub Desktop.
Save beeblebrox3/3a9dc79b644aed1bbf0ea79159acd004 to your computer and use it in GitHub Desktop.
import App from "app";
const Pages = App.components.pages;
const Router = App.service("ROUTER");
Router.setDefaultLayout(App.components.Application);
Router.setDefaultTitle("Elydi");
Router.addRoute("/", Pages.Home);
Router.addRoute("/another-home", Pages.Home);
Router.addResolver(":userID", (value, ctx, next) => {
App.service("Users").find(id).then(user => {
ctx.user = user;
next();
})
})
Router.addRoute("/users/:userID", Pages.Users);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment