Skip to content

Instantly share code, notes, and snippets.

@cdb
Last active September 24, 2022 00:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdb/9c09b901c810190e8654e2154c629458 to your computer and use it in GitHub Desktop.
Save cdb/9c09b901c810190e8654e2154c629458 to your computer and use it in GitHub Desktop.
Deno.core.print("Middleware loaded\n");
export function RequestHandler(/*req, res*/) {
//req.headers.set("X-Request-Middleware", "true");
Deno.core.print("Request middleware\n");
Deno.core.print("from a gist\n");
};
export function ResponseHandler(/*req, res*/) {
Deno.core.print("Response middleware\n");
runjs.addHeader("x-header-from-middleware", "hello from a gist");
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment