diff --git a/src/plugins/fs_routes/mod.ts b/src/plugins/fs_routes/mod.ts index a91a75cb49b..c44e3d8bbc0 100644 --- a/src/plugins/fs_routes/mod.ts +++ b/src/plugins/fs_routes/mod.ts @@ -4,7 +4,7 @@ import type { WalkEntry } from "@std/fs/walk"; import * as path from "@std/path"; import type { RouteConfig } from "../../types.ts"; import type { RouteHandler } from "../../handlers.ts"; -import type { Middleware, MiddlewareFn } from "../../middlewares/mod.ts"; +import type { MiddlewareFn } from "../../middlewares/mod.ts"; import { type AsyncAnyComponent, renderMiddleware, @@ -34,8 +34,7 @@ export interface FreshFsItem { handlers?: RouteHandler; default?: | AnyComponent> - | AsyncAnyComponent> - | Middleware; + | AsyncAnyComponent>; } // deno-lint-ignore no-explicit-any diff --git a/src/plugins/fs_routes/mod_test.tsx b/src/plugins/fs_routes/mod_test.tsx index 96f4818e5d0..41db660b96a 100644 --- a/src/plugins/fs_routes/mod_test.tsx +++ b/src/plugins/fs_routes/mod_test.tsx @@ -176,10 +176,11 @@ Deno.test("fsRoutes - middleware", async () => { const server = await createServer<{ text: string }>({ "routes/index.ts": { handler: (ctx) => new Response(ctx.state.text) }, "routes/_middleware.ts": { - default: (ctx: FreshContext<{ text: string }>) => { + default: ((ctx: FreshContext<{ text: string }>) => { ctx.state.text = "ok"; return ctx.next(); - }, + // deno-lint-ignore no-explicit-any + }) as any, }, });