- Add the Hono routing framework to simplify route handling
- Serve static files from a
public/directory
npm install honoReplace your existing handler with this Hono app setup:
import { Hono } from 'hono';
const app = new Hono();
export default app;Ensure your wrangler.jsonc includes the static assets section:
"assets": {
"directory": "./public",
"binding": "ASSETS",
}This tells Cloudflare Workers to bind your./public folder to the ASSETS binding. After adding a binding to wrangler.jsonc you can run npm run cf-typegen to generate types for your bindings.
npm run dev