Skip to content

Instantly share code, notes, and snippets.

@darkslategrey
Created March 26, 2015 16:22
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 darkslategrey/7c755fd05ce343831dda to your computer and use it in GitHub Desktop.
Save darkslategrey/7c755fd05ce343831dda to your computer and use it in GitHub Desktop.
router = require('myrouter');
TokenSrv = require('js/Token');
LocationSrv = require('js/Location');
services = {
token: TokenSrv,
location: LocationSrv
};
app.use('/path', router(services));
// myrouter.js
module.exports = function(services) {
router = require('express').Router();
router.get('/locations/show', services.location);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment