leon
leon
Explore posts from servers
CDCloudflare Developers
Created by leon on 3/7/2025 in #workers-help
hono static files return 404 in wrangler dev and worker when in subdirectory of assets folder
Hello, i am using hono with a cloudflare worker to serve the asset folder 'assets' as seen in the examples:
<p>
Try visiting: <a href="/my-file.txt">/my-file.txt</a> and <a href="/folder/nested-file.txt">/folder/nested-file.txt</a>
</p>
<p>
Try visiting: <a href="/my-file.txt">/my-file.txt</a> and <a href="/folder/nested-file.txt">/folder/nested-file.txt</a>
</p>
both files exist in the assets directory (it is the serve-static hono github example) however Hono loads the file my-file.txt from the assets root but /folder/nested-file.txtgives a file not found 404 all config is the standard given here: https://github.com/honojs/examples/tree/main/serve-static i have no idea why even the example is not working. any ideas to try would be great!
2 replies
HHono
Created by leon on 3/7/2025 in #help
static files 404 when in subdirectory of assets
Hello, i am using hono with a cloudflare worker to serve the asset folder 'assets' as seen in the examples:
<p>
Try visiting: <a href="/my-file.txt">/my-file.txt</a> and <a href="/folder/nested-file.txt">/folder/nested-file.txt</a>
</p>
<p>
Try visiting: <a href="/my-file.txt">/my-file.txt</a> and <a href="/folder/nested-file.txt">/folder/nested-file.txt</a>
</p>
both files exist in the assets directory (it is the serve-static hono github example) however Hono loads the file my-file.txt from the assets root but /folder/nested-file.txtgives a file not found 404 all config is the standard given here: https://github.com/honojs/examples/tree/main/serve-static i have no idea why even the example is not working. any ideas to try would be great!
12 replies