Skip to content

Instantly share code, notes, and snippets.

@microbial
Last active December 4, 2015 04:11
Show Gist options
  • Save microbial/c55264be33ed3f1ac7a8 to your computer and use it in GitHub Desktop.
Save microbial/c55264be33ed3f1ac7a8 to your computer and use it in GitHub Desktop.
Express Init
//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