© 2026 Hedgehog Software, LLC
index.html
index.tsx
import { Hono } from "hono"; const app = new Hono(); const routes = app.get("/api/clock", (c) => { return c.json({ time: new Date().toLocaleTimeString(), }); }); export type AppType = typeof routes; app.get("/", (c) => { return c.html( `<html lang="en"> <head> <meta charset="UTF-8" /> <link rel="icon" type="image/svg+xml" href="/vite.svg" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Vite + React + Hono</title> </head> <body> <div id="root"/> <script type="module" src="/src/app/main.tsx"></script> </body> </html>` ); }); export default app;
import build from "@hono/vite-build/cloudflare-workers"
import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import { cloudflare } from "@cloudflare/vite-plugin"; import path from "path"; import tailwindcss from "@tailwindcss/vite"; import devServer from "@hono/vite-dev-server"; import build from "@hono/vite-build/cloudflare-workers"; export default defineConfig({ plugins: [ react(), cloudflare(), tailwindcss(), build({ entry: "index.tsx", }), devServer({ entry: "index.tsx", }), ], resolve: { alias: { "@": path.resolve(__dirname, "./src"), }, }, });