Created
November 7, 2012 22:11
-
-
Save makensi/4034836 to your computer and use it in GitHub Desktop.
An example applying middleware pre validation.
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
// post management after get | |
exports.get("/my/admin/url", | |
function(request, response, next){ | |
if(request.session.user){ | |
next(); | |
}else{ | |
response.status(403).redirect("/login"); | |
} | |
}, | |
function(request, response){ | |
response.render("myAdminPage",{}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment