Skip to content

Instantly share code, notes, and snippets.

@yoshuawuyts
Created May 20, 2017 17:42
Show Gist options
  • Save yoshuawuyts/88f855297a195f0c3fb09fe7e24e82c3 to your computer and use it in GitHub Desktop.
Save yoshuawuyts/88f855297a195f0c3fb09fe7e24e82c3 to your computer and use it in GitHub Desktop.
var app = choo()
app.route('/hi', hiView)
app.route('/hello', helloView)
// static redirect
app.route('/greet', redirect('/hello'))
// conditional
app.route('/greet', function (state, emit) {
if (!state.user.sid) return hiView(state, emit)
else return helloView(state, emit)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment