serve-static.d.ts 698 B

1234567891011121314151617
  1. import { Env, Context, MiddlewareHandler } from 'hono';
  2. type ServeStaticOptions<E extends Env = Env> = {
  3. /**
  4. * Root path, relative to current working directory from which the app was started. Absolute paths are not supported.
  5. */
  6. root?: string;
  7. path?: string;
  8. index?: string;
  9. precompressed?: boolean;
  10. rewriteRequestPath?: (path: string, c: Context<E>) => string;
  11. onFound?: (path: string, c: Context<E>) => void | Promise<void>;
  12. onNotFound?: (path: string, c: Context<E>) => void | Promise<void>;
  13. };
  14. declare const serveStatic: <E extends Env = any>(options?: ServeStaticOptions<E>) => MiddlewareHandler<E>;
  15. export { type ServeStaticOptions, serveStatic };