Blame · Line-by-line history
app.ts
Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.
| fc1817a | 1 | import { Hono } from "hono"; |
| 2 | import { logger } from "hono/logger"; | |
| 3 | import { cors } from "hono/cors"; | |
| 4 | import gitRoutes from "./routes/git"; | |
| 5 | import apiRoutes from "./routes/api"; | |
| 06d5ffe | 6 | import authRoutes from "./routes/auth"; |
| 7 | import settingsRoutes from "./routes/settings"; | |
| fc1817a | 8 | import webRoutes from "./routes/web"; |
| 9 | ||
| 10 | const app = new Hono(); | |
| 11 | ||
| 12 | // Middleware | |
| 13 | app.use("*", logger()); | |
| 14 | app.use("/api/*", cors()); | |
| 15 | ||
| 16 | // Git Smart HTTP protocol routes (must be before web routes) | |
| 17 | app.route("/", gitRoutes); | |
| 18 | ||
| 19 | // REST API | |
| 20 | app.route("/", apiRoutes); | |
| 21 | ||
| 06d5ffe | 22 | // Auth routes (register, login, logout) |
| 23 | app.route("/", authRoutes); | |
| 24 | ||
| 25 | // Settings routes (profile, SSH keys) — requires auth | |
| 26 | app.route("/", settingsRoutes); | |
| 27 | ||
| fc1817a | 28 | // Web UI (catch-all, must be last) |
| 29 | app.route("/", webRoutes); | |
| 30 | ||
| 31 | export default app; |