diff --git a/examples/tool/src/middlewares/context.middleware.ts b/examples/tool/src/middlewares/context.middleware.ts index 00fb5ec..89f92d3 100644 --- a/examples/tool/src/middlewares/context.middleware.ts +++ b/examples/tool/src/middlewares/context.middleware.ts @@ -3,7 +3,7 @@ import type { Get, UniversalMiddleware } from "@universal-middleware/core"; -const contextMiddleware = ((value) => (request, ctx) => { +const contextMiddleware = ((value) => (request, ctx, runtime) => { // Return the new universal context, thus keeping complete type safety // A less typesafe way to do the same thing would be to `ctx.something = value` and return nothing return { diff --git a/examples/tool/src/middlewares/guard.middleware.ts b/examples/tool/src/middlewares/guard.middleware.ts index 18e9420..b2fdb08 100644 --- a/examples/tool/src/middlewares/guard.middleware.ts +++ b/examples/tool/src/middlewares/guard.middleware.ts @@ -9,7 +9,7 @@ interface User { } // This middleware will return an early Response for unauthenticated users -const guardMiddleware = (() => (request, ctx) => { +const guardMiddleware = (() => (request, ctx, runtime) => { if (!ctx?.user) { return new Response("Unauthorized", { status: 401, diff --git a/examples/tool/src/middlewares/headers.middleware.ts b/examples/tool/src/middlewares/headers.middleware.ts index 33370ea..a9ac53e 100644 --- a/examples/tool/src/middlewares/headers.middleware.ts +++ b/examples/tool/src/middlewares/headers.middleware.ts @@ -4,7 +4,7 @@ import type { Get, UniversalMiddleware } from "@universal-middleware/core"; // This middleware will add a `X-Universal-Hello` header to all responses -const headersMiddleware = (() => (request, ctx) => { +const headersMiddleware = (() => (request, ctx, runtime) => { return (response) => { // `ctx.hello` exists if it has been set by another middleware response.headers.set("X-Universal-Hello", ctx.hello ?? "world");