Skip to content

Instantly share code, notes, and snippets.

@rxw1
Created July 5, 2020 01:47
Show Gist options
  • Save rxw1/29974819253ee88556ff33df8f3fd1c9 to your computer and use it in GitHub Desktop.
Save rxw1/29974819253ee88556ff33df8f3fd1c9 to your computer and use it in GitHub Desktop.
Request Headers (Node.js + Koa)
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