armout
armout
CDCloudflare Developers
Created by armout on 11/10/2024 in #workers-help
Best way to serve static assets using hono?
I want to create an endpoint (for ex endpoint.com/script.js) that serves a script file. right now, im returning the contents of the file directly by
return c.text(scriptContent, 200, {
'Content-Type': 'application/javascript'
});
return c.text(scriptContent, 200, {
'Content-Type': 'application/javascript'
});
i was wondering if there was an easier way to directly serve the static file by name
3 replies