Skip to content

Instantly share code, notes, and snippets.

@jason-dark
Created July 8, 2018 22:13
Show Gist options
  • Save jason-dark/d3a6bb90846ed7c350778206781d5a19 to your computer and use it in GitHub Desktop.
Save jason-dark/d3a6bb90846ed7c350778206781d5a19 to your computer and use it in GitHub Desktop.
function sendRes(res, status, data) {
console.log("✔ Sending response");
res.set({
'content-type': 'application/json',
'Access-Control-Allow-Origin': '*'
}).status(status)
.send(JSON.stringify({
"status": status,
"data": data
})).end();
}
module.exports = sendRes;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment