Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

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

Fast, Lightweight, Web-standards
Very Popular
Go to Latest
variable serveStatic
import { serveStatic } from "https://deno.land/x/hono@v4.2.5/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) => any; pathResolve?: (path: string) => string; }) => MiddlewareHandler