Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/hono/middleware/serve-static/index.ts>serveStatic

Web Framework built on Web Standards
Extremely Popular
Latest
variable serveStatic
import { serveStatic } from "https://deno.land/x/hono@v4.3.11/middleware/serve-static/index.ts";

This middleware is not directly used by the user. Create a wrapper specifying getContent() by the environment such as Deno or Bun.

type

<E extends Env = Env>(options: ServeStaticOptions<E> & { getContent: (path: string, c: Context<E>) => Promise<Data | Response | null>; pathResolve?: (path: string) => string; }) => MiddlewareHandler