node-server
node-server copied to clipboard
serveStatic isn't working
serve static is not working, iam not using absolute path, minimal repro https://github.com/ibnumusyaffa/hono-serve-static-not-working
Hi @ibnumusyaffa
Thank you for creating the issue.
You can do what you want to do with the following code:
app.get(
"/static/*",
serveStatic({
root: "./storage",
rewriteRequestPath: (path: string) => path.replace(/^\/static/, ""),
})
)
I would like to introduce onNotFound() because the current implementation of @hono/node-server is difficult to debug when a file is not found.
This can be closed. Thanks!