/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-serve-static-files-2ddaa6b15818-serve-static-files-s0435-c0000.md

Serve static files - hono-docs

Serve static files Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://hono.dev/llms full.txt serve static files Summary To...

Serve static files

Source evidence: /Sources/raw/honojshono/honojshono.md Canonical citation: https://hono.dev/llms-full.txt#serve-static-files

Summary

To serve static files, use serveStatic imported from hono/deno. ```ts import { Hono } from 'hono' import { serveStatic } from 'hono/deno' const app = new Hono() app.use('/static/*', serveStatic({ root: './' })) app.use('/favicon.ico'...

Content

To serve static files, use serveStatic imported from hono/deno.

import { Hono } from 'hono'
import { serveStatic } from 'hono/deno'

const app = new Hono()

app.use('/static/*', serveStatic({ root: './' }))
app.use('/favicon.ico', serveStatic({ path: './favicon.ico' }))
app.get('/', (c) => c.text('You can access: /static/hello.txt'))
app.get('*', serveStatic({ path: './static/fallback.txt' }))

Deno.serve(app.fetch)

For the above code, it will work well with the following directory structure.

./
├── favicon.ico
├── index.ts
└── static
    ├── demo
    │   └── index.html
    ├── fallback.txt
    ├── hello.txt
    └── images
        └── dinotocat.png
Kinic Wiki
Loading knowledge node
Details

Identity

database
db_23dhmsxlhukv
database_id
db_23dhmsxlhukv
path
/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-serve-static-files-2ddaa6b15818-serve-static-files-s0435-c0000.md
kind
directory
role
markdown_note
children
0

Metadata

created_at
virtual
updated_at
virtual
etag
virtual
metadata_json
{}

Lint Hints

No lightweight warnings.

Outgoing Links

No outgoing links indexed.

Incoming Links

Select a file node to inspect backlinks.

Raw Source

No raw source path inferred.