Created
July 5, 2020 01:47
-
-
Save rxw1/29974819253ee88556ff33df8f3fd1c9 to your computer and use it in GitHub Desktop.
Request Headers (Node.js + Koa)
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
const Koa = require("koa"); | |
const app = new Koa(); | |
app.use((ctx) => { | |
ctx.body = `${ctx.method}, ${ctx.path}, ${JSON.stringify( | |
ctx.headers, | |
null, | |
2 | |
)}`; | |
}); | |
app.listen(3444); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment