Created
May 12, 2017 01:11
-
-
Save beeblebrox3/075d85b6f74e9ee24247f0dd0fb870c2 to your computer and use it in GitHub Desktop.
routes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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