Skip to content

Instantly share code, notes, and snippets.

@beeblebrox3
Created May 12, 2017 01:11
Show Gist options
  • Save beeblebrox3/075d85b6f74e9ee24247f0dd0fb870c2 to your computer and use it in GitHub Desktop.
Save beeblebrox3/075d85b6f74e9ee24247f0dd0fb870c2 to your computer and use it in GitHub Desktop.
routes
import App from "app";
const Router = App.ServicesContainer.get("ROUTER");
const Pages = App.components.pages;
Router.setDefaultLayout(App.components.Application);
Router.addResolver("movieID", (param, context, next) => {
App.ServicesContainer.get("Movies").get(param, (movie) => {
context.params.movie = movie;
next(context);
});
});
Router.addRoutes({
"/": Pages.Home,
"/foo": {
name: "foo",
title: "Foo",
component: Pages.Foo
},
"/movies": Pages.Movies,
"/movies/:movieID": Pages.Movie
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment