Last active
December 4, 2015 04:11
-
-
Save microbial/c55264be33ed3f1ac7a8 to your computer and use it in GitHub Desktop.
Express Init
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
//In the express server file | |
var express = require('express'); | |
var app = express(); | |
app.use((function(appInstance) { | |
'use strict'; | |
return function(req, res, next) { | |
appInstance.locals.mongo = require('mongodb'); | |
appInstance.locals.uuid = require('uuid'); | |
req.mongo = appInstance.locals.mongo; | |
req.uuid = appInstance.locals.uuid; | |
next(); | |
}; | |
})(app)); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment