feat(01-01): scaffold project with Vite, Hono, TanStack Router, Tailwind, and Drizzle config
- Initialize bun project with all frontend/backend dependencies - Configure Vite with TanStack Router plugin, React, and Tailwind v4 - Create Hono server with health check and static file serving - Set up TanStack Router file-based routes with root layout - Add Drizzle config, Biome linter, and proper .gitignore Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
20
src/server/index.ts
Normal file
20
src/server/index.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Hono } from "hono";
|
||||
import { serveStatic } from "hono/bun";
|
||||
|
||||
const app = new Hono();
|
||||
|
||||
// Health check
|
||||
app.get("/api/health", (c) => {
|
||||
return c.json({ status: "ok" });
|
||||
});
|
||||
|
||||
// Serve uploaded images
|
||||
app.use("/uploads/*", serveStatic({ root: "./" }));
|
||||
|
||||
// Serve Vite-built SPA in production
|
||||
if (process.env.NODE_ENV === "production") {
|
||||
app.use("/*", serveStatic({ root: "./dist/client" }));
|
||||
app.get("*", serveStatic({ path: "./dist/client/index.html" }));
|
||||
}
|
||||
|
||||
export default { port: 3000, fetch: app.fetch };
|
||||
Reference in New Issue
Block a user