Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
CodeIssuesPull RequestsActionsSecurityInsightsSettings
✨ AI
More
Blame · Line-by-line history

app.tsx

Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.

app.tsxBlame87 lines · 1 contributor
79136bbClaude1import { Hono } from "hono";
2import { logger } from "hono/logger";
3import { cors } from "hono/cors";
4import { Layout } from "./views/layout";
5import gitRoutes from "./routes/git";
6import apiRoutes from "./routes/api";
7import authRoutes from "./routes/auth";
8import settingsRoutes from "./routes/settings";
9import issueRoutes from "./routes/issues";
10import repoSettings from "./routes/repo-settings";
11import compareRoutes from "./routes/compare";
0074234Claude12import pullRoutes from "./routes/pulls";
13import editorRoutes from "./routes/editor";
79136bbClaude14import webRoutes from "./routes/web";
15
16const app = new Hono();
17
18// Middleware
19app.use("*", logger());
20app.use("/api/*", cors());
21
22// Git Smart HTTP protocol routes (must be before web routes)
23app.route("/", gitRoutes);
24
25// REST API
26app.route("/", apiRoutes);
27
28// Auth routes (register, login, logout)
29app.route("/", authRoutes);
30
31// Settings routes (profile, SSH keys)
32app.route("/", settingsRoutes);
33
34// Repo settings (description, visibility, delete)
35app.route("/", repoSettings);
36
37// Compare view (branch diffs)
38app.route("/", compareRoutes);
39
40// Issue tracker
41app.route("/", issueRoutes);
42
0074234Claude43// Pull requests
44app.route("/", pullRoutes);
45
46// Web file editor
47app.route("/", editorRoutes);
48
79136bbClaude49// Web UI (catch-all, must be last)
50app.route("/", webRoutes);
51
52// Global 404
53app.notFound((c) => {
54 return c.html(
55 <Layout title="Not Found">
56 <div class="empty-state">
57 <h2>404</h2>
58 <p>Page not found.</p>
59 <a href="/" style="margin-top: 12px; display: inline-block">
60 Go home
61 </a>
62 </div>
63 </Layout>,
64 404
65 );
66});
67
68// Global error handler
69app.onError((err, c) => {
70 console.error("[error]", err);
71 return c.html(
72 <Layout title="Error">
73 <div class="empty-state">
74 <h2>Something went wrong</h2>
75 <p>An unexpected error occurred.</p>
76 {process.env.NODE_ENV !== "production" && (
77 <pre style="margin-top: 16px; text-align: left; font-size: 12px; color: var(--red)">
78 {err.message}
79 </pre>
80 )}
81 </div>
82 </Layout>,
83 500
84 );
85});
86
87export default app;