Skip to content

Instantly share code, notes, and snippets.

@iamjohnlong
Created August 28, 2015 15:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamjohnlong/bf30a0bd32608fb7131f to your computer and use it in GitHub Desktop.
Save iamjohnlong/bf30a0bd32608fb7131f to your computer and use it in GitHub Desktop.
// The profile model
var profile = require('./profile').get()
profile.then(function() {
AppRouter()
}, function() {
LoginRouter()
})
function AppRouter() {
document.body.id = 'authenticated'
m.route(document.body, '/', {
'/': YourAppComponent
})
}
function LoginRouter() {
document.body.id = 'login'
m.route(document.body, '/', {
'/': YourLoginComponent
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment