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.tsxBlame111 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";
c81ab7aClaude14import forkRoutes from "./routes/fork";
15import webhookRoutes from "./routes/webhooks";
16import exploreRoutes from "./routes/explore";
17import tokenRoutes from "./routes/tokens";
43de941Claude18import contributorRoutes from "./routes/contributors";
2c34075Claude19import healthRoutes from "./routes/health";
79136bbClaude20import webRoutes from "./routes/web";
21
22const app = new Hono();
23
24// Middleware
25app.use("*", logger());
26app.use("/api/*", cors());
27
28// Git Smart HTTP protocol routes (must be before web routes)
29app.route("/", gitRoutes);
30
31// REST API
32app.route("/", apiRoutes);
33
34// Auth routes (register, login, logout)
35app.route("/", authRoutes);
36
37// Settings routes (profile, SSH keys)
38app.route("/", settingsRoutes);
39
c81ab7aClaude40// API tokens
41app.route("/", tokenRoutes);
42
79136bbClaude43// Repo settings (description, visibility, delete)
44app.route("/", repoSettings);
45
c81ab7aClaude46// Webhooks management
47app.route("/", webhookRoutes);
48
79136bbClaude49// Compare view (branch diffs)
50app.route("/", compareRoutes);
51
52// Issue tracker
53app.route("/", issueRoutes);
54
0074234Claude55// Pull requests
56app.route("/", pullRoutes);
57
c81ab7aClaude58// Fork
59app.route("/", forkRoutes);
60
0074234Claude61// Web file editor
62app.route("/", editorRoutes);
63
43de941Claude64// Contributors
65app.route("/", contributorRoutes);
66
2c34075Claude67// Health dashboard
68app.route("/", healthRoutes);
69
c81ab7aClaude70// Explore page
71app.route("/", exploreRoutes);
72
79136bbClaude73// Web UI (catch-all, must be last)
74app.route("/", webRoutes);
75
76// Global 404
77app.notFound((c) => {
78 return c.html(
79 <Layout title="Not Found">
80 <div class="empty-state">
81 <h2>404</h2>
82 <p>Page not found.</p>
83 <a href="/" style="margin-top: 12px; display: inline-block">
84 Go home
85 </a>
86 </div>
87 </Layout>,
88 404
89 );
90});
91
92// Global error handler
93app.onError((err, c) => {
94 console.error("[error]", err);
95 return c.html(
96 <Layout title="Error">
97 <div class="empty-state">
98 <h2>Something went wrong</h2>
99 <p>An unexpected error occurred.</p>
100 {process.env.NODE_ENV !== "production" && (
101 <pre style="margin-top: 16px; text-align: left; font-size: 12px; color: var(--red)">
102 {err.message}
103 </pre>
104 )}
105 </div>
106 </Layout>,
107 500
108 );
109});
110
111export default app;