Skip to content

Instantly share code, notes, and snippets.

@Broich
Created June 30, 2019 08:13
Show Gist options
  • Save Broich/5803790464461a4812396a90a9333fe1 to your computer and use it in GitHub Desktop.
Save Broich/5803790464461a4812396a90a9333fe1 to your computer and use it in GitHub Desktop.
server.get('/bla', function(req, res) {
// instead of adding the implementation here
});
// create a new function here
function doBla(req, res) {
// implementation here
});
// now add it to exports
server.doBla = doBla;
// and in the actual endpoint just call the function
server.get('/bla', function(req, res) {
doBla(req, res);
});
module.exports = server;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment