Skip to content

How to exclude a file from serveStatic #3586

Answered by maou-shonen
charnould asked this question in Q&A
Discussion options

You must be logged in to vote

This is in the official docs,
for your example

const app = new Hono()

app.get('/assets/config.ts', (c) => c.notFound())
app.use('/assets/*', serveStatic({ root: './' }))

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@charnould
Comment options

Answer selected by charnould
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants