Skip to content

Instantly share code, notes, and snippets.

@ganeshkbhat
Created May 10, 2022 11:22
Show Gist options
  • Save ganeshkbhat/c8a800de07b99e5a7e5813ffaac39307 to your computer and use it in GitHub Desktop.
Save ganeshkbhat/c8a800de07b99e5a7e5813ffaac39307 to your computer and use it in GitHub Desktop.
middlewaretemplates
function someMiddlewareName(req, res, next) {
console.log("Simple middleware Template");
next();
}
module.exports = someMiddlewareName
function someRouteCallbackName(req, res, next) {
console.log("Simple Route Based Function Template");
res.status(200).send("My logic based response");
}
module.exports = someRouteCallbackName
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