Created
May 20, 2017 17:42
-
-
Save yoshuawuyts/88f855297a195f0c3fb09fe7e24e82c3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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