Serving Static Files - Hono

So I am trying to convert a previous project of mine from express to Hono (IDK if its the best option or not.. I'd like some feedback/advice). I always start by deploying static stuff to check if everything is according to plan, however I don't seem to be able and serve my static 404 page. From what I gather I have to add to the toml file the following:
assets = { directory = "src/public", binding = "ASSETS", html_handling = "force-trailing-slash", not_found_handling = "404-page" }
assets = { directory = "src/public", binding = "ASSETS", html_handling = "force-trailing-slash", not_found_handling = "404-page" }
Am I suppose to add something else in my index.ts file ? I saw Hono has the following possibility
app.notFound((c) => {
return c.text('Oops not found.', 404)
})
app.notFound((c) => {
return c.text('Oops not found.', 404)
})
I can serve the file if I past it plain in the index.ts file, however for code/folder structure purposes I prefer not to do so... I'd really appreciate some help in this manner. Cheers :cheers:
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server