Skip to content

Instantly share code, notes, and snippets.

@qcom
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qcom/47e803dfc27e32f03b3d to your computer and use it in GitHub Desktop.
Save qcom/47e803dfc27e32f03b3d to your computer and use it in GitHub Desktop.
/* 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