feat(deploy): serve SPA from server, Dockerfile, compose, deploy docs
- Add serveStatic middleware to server/src/app.ts to serve web/dist - Include SPA fallback route for client-side routing deep links - Create Dockerfile with multi-stage build (Node deps + build, slim runtime) - Add docker-compose.yml for single-command deployment - Add docs/deploy.md with deployment instructions and Caddy reverse proxy example - Add bun run build:web step to CI pipeline after typecheck Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Hono } from "hono";
|
||||
import { getCookie } from "hono/cookie";
|
||||
import { serveStatic } from "hono/bun";
|
||||
import type { Db } from "./db";
|
||||
import { authRoutes, isAuthenticated } from "./routes/auth";
|
||||
import { settingsRoutes } from "./routes/settings";
|
||||
@@ -20,5 +21,7 @@ export function createApp(deps: Deps) {
|
||||
app.route("/api", authRoutes({ db: deps.db }));
|
||||
app.route("/api", settingsRoutes(deps));
|
||||
// Later route groups (connectors, chat) mount here.
|
||||
app.use("/*", serveStatic({ root: "./web/dist" }));
|
||||
app.get("/*", serveStatic({ path: "./web/dist/index.html" }));
|
||||
return app;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user