Skip to content

Instantly share code, notes, and snippets.

@k0d3d
Created March 2, 2019 16:54
Show Gist options
  • Save k0d3d/a55c59bd7c8e6803705e0aa6e61899e6 to your computer and use it in GitHub Desktop.
Save k0d3d/a55c59bd7c8e6803705e0aa6e61899e6 to your computer and use it in GitHub Desktop.
a simple function that always responds to requests
module.exports.returnResponse = async function returnResponse (context, page, status) {
context.res = {
status,
body: await page.content(),
headers: {
"Content-Type": "text/html",
"Current-Page_Url": await page.url()
}
};
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment