Last active
August 29, 2015 14:05
-
-
Save qcom/47e803dfc27e32f03b3d to your computer and use it in GitHub Desktop.
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
/* app.js */ | |
var express = require('express'); | |
var app = express(); | |
app.set('db', myDbHandle) | |
var login = require('./lib/login'); | |
app.use(login(app)); | |
/* lib/login */ | |
var express = require('express'); | |
var router = express.Router(); | |
module.exports = function(app) { | |
router.get('/login', function(req, res) { | |
app.get('db').myDbMethod(function(err, body) { | |
res.render('login', { data : body }); | |
}); | |
}); | |
return router; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment