Initialize Minabot with Hono and React Router

This commit is contained in:
syntaxbullet
2026-09-04 07:40:35 +02:00
commit 23e9f4c717
18 changed files with 553 additions and 0 deletions

23
src/index.ts Normal file
View File

@@ -0,0 +1,23 @@
import { Hono } from "hono";
import index from "./index.html";
const app = new Hono();
app.get("/api/health", c => c.json({ status: "ok" }));
app.notFound(c => c.json({ error: "Not found" }, 404));
const server = Bun.serve({
hostname: "127.0.0.1",
port: Number(process.env.PORT ?? 3000),
routes: {
"/api": req => app.fetch(req),
"/api/*": req => app.fetch(req),
"/*": index,
},
development: process.env.NODE_ENV !== "production" && {
hmr: true,
console: true,
},
});
console.log(`Server running at ${server.url}`);