Created
June 30, 2019 08:13
-
-
Save Broich/5803790464461a4812396a90a9333fe1 to your computer and use it in GitHub Desktop.
This file contains 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
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