Created
May 10, 2022 11:22
-
-
Save ganeshkbhat/c8a800de07b99e5a7e5813ffaac39307 to your computer and use it in GitHub Desktop.
middlewaretemplates
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
function someMiddlewareName(req, res, next) { | |
console.log("Simple middleware Template"); | |
next(); | |
} | |
module.exports = someMiddlewareName |
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
function someRouteCallbackName(req, res, next) { | |
console.log("Simple Route Based Function Template"); | |
res.status(200).send("My logic based response"); | |
} | |
module.exports = someRouteCallbackName |
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
function someRouteTemplatisedCallbackName(req, res, next) { | |
console.log("Simple Route Based Templatised Function Template"); | |
res.render("index", "./path/to/template"); | |
} | |
module.exports = someRouteTemplatisedCallbackName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment