Created
March 2, 2019 16:54
-
-
Save k0d3d/a55c59bd7c8e6803705e0aa6e61899e6 to your computer and use it in GitHub Desktop.
a simple function that always responds to requests
This file contains hidden or 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
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