Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

Pull out route-handler callbacks #43

Open
douglascalhoun opened this issue Apr 24, 2014 · 0 comments
Open

Pull out route-handler callbacks #43

douglascalhoun opened this issue Apr 24, 2014 · 0 comments

Comments

@douglascalhoun
Copy link

route-handler.js is a bit on the longer & messier side.

Consider pulling out the callback functions to individual routes into their own file, (i.e. routes.js)...

// route-handler.js
var routes = require('./routes');
app.get('/', routes.index);
app.get('/db/returning', routes.dbReturning);

// routes.js
module.exports = {
  index: function(){ ... },
  dbReturning: function(){ ... },
  ...
};
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant