Created
March 10, 2013 07:26
-
-
Save Lewuathe/5127496 to your computer and use it in GitHub Desktop.
Basic authentication with express ref: http://qiita.com/items/f6e539cfe9cd19822017
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 auth = express.basicAuth(function(user,pass){ | |
| return user === myuser && pass === mypasswd; | |
| }); |
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
| app.get("/admin", auth, function(req, res){ | |
| res.render("admin", { title : "This is admin" }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment