CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
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.
| 79136bb | 1 | import { Hono } from "hono"; |
| 2 | import { logger } from "hono/logger"; | |
| 3 | import { cors } from "hono/cors"; | |
| 05b973e | 4 | import { compress } from "hono/compress"; |
| f1ffd50 | 5 | import { etag } from "hono/etag"; |
| c63b860 | 6 | // BLOCK O2 — shared error-page surface (404 / 500 / 403). |
| 7 | import { NotFoundPage, ServerErrorPage } from "./views/error-page"; | |
| 80bed05 | 8 | import { reportError } from "./lib/observability"; |
| 3ef4c9d | 9 | import { requestContext } from "./middleware/request-context"; |
| 10 | import { rateLimit } from "./middleware/rate-limit"; | |
| 79136bb | 11 | import gitRoutes from "./routes/git"; |
| 12 | import apiRoutes from "./routes/api"; | |
| 45e31d0 | 13 | import apiV2Routes from "./routes/api-v2"; |
| 14 | import apiDocsRoutes from "./routes/api-docs"; | |
| 4a80519 | 15 | import buildAgentSpecRoutes from "./routes/build-agent-spec"; |
| a6ff0f2 | 16 | import pullsDashboardRoutes from "./routes/pulls-dashboard"; |
| e9aa4d8 | 17 | import issuesDashboardRoutes from "./routes/issues-dashboard"; |
| 18 | import inboxRoutes from "./routes/inbox"; | |
| 19 | import activityRoutes from "./routes/activity"; | |
| 79136bb | 20 | import authRoutes from "./routes/auth"; |
| c63b860 | 21 | import passwordResetRoutes from "./routes/password-reset"; |
| 22 | import emailVerificationRoutes from "./routes/email-verification"; | |
| cd4f63b | 23 | import magicLinkRoutes from "./routes/magic-link"; |
| 79136bb | 24 | import settingsRoutes from "./routes/settings"; |
| 7298a17 | 25 | import settings2faRoutes from "./routes/settings-2fa"; |
| e75eddc | 26 | import settingsAgentsRoutes from "./routes/settings-agents"; |
| 1d4ff60 | 27 | import settingsIntegrationsRoutes from "./routes/settings-integrations"; |
| 28 | import integrationsChatRoutes from "./routes/integrations-chat"; | |
| e75eddc | 29 | import agentsRoutes from "./routes/agents"; |
| ef3fd93 | 30 | import agentPipelinesRoutes from "./routes/agent-pipelines"; |
| 79136bb | 31 | import issueRoutes from "./routes/issues"; |
| cb5a796 | 32 | import commentModerationRoutes from "./routes/comment-moderation"; |
| 79136bb | 33 | import repoSettings from "./routes/repo-settings"; |
| 23d1a81 | 34 | import collaboratorRoutes from "./routes/collaborators"; |
| 04f6b7f | 35 | import teamCollaboratorRoutes from "./routes/team-collaborators"; |
| 36 | import invitesRoutes from "./routes/invites"; | |
| 37 | import liveEventsRoutes from "./routes/live-events"; | |
| 3c03977 | 38 | import prLiveRoutes from "./routes/pr-live"; |
| 79136bb | 39 | import compareRoutes from "./routes/compare"; |
| 0074234 | 40 | import pullRoutes from "./routes/pulls"; |
| 79ed944 | 41 | import prSandboxRoutes from "./routes/pr-sandbox"; |
| 9b3a183 | 42 | import devEnvRoutes from "./routes/dev-env"; |
| 0074234 | 43 | import editorRoutes from "./routes/editor"; |
| c81ab7a | 44 | import forkRoutes from "./routes/fork"; |
| 45 | import webhookRoutes from "./routes/webhooks"; | |
| 46 | import exploreRoutes from "./routes/explore"; | |
| 47 | import tokenRoutes from "./routes/tokens"; | |
| 43de941 | 48 | import contributorRoutes from "./routes/contributors"; |
| 699e5c7 | 49 | import healthRoutes from "./routes/health-probe"; |
| 50 | import healthDashboardRoutes from "./routes/health"; | |
| 2316be6 | 51 | import statusRoutes from "./routes/status"; |
| b1be050 | 52 | import adminStatusRoutes from "./routes/admin-status"; |
| 80bed05 | 53 | import helpRoutes from "./routes/help"; |
| e1fc7db | 54 | import changelogRoutes from "./routes/changelog"; |
| e0e4219 | 55 | import docsRoutes from "./routes/docs"; |
| b0148e9 | 56 | import marketingRoutes from "./routes/marketing"; |
| 5f2e749 | 57 | import pricingRoutes from "./routes/pricing"; |
| 9f29b65 | 58 | import enterpriseRoutes from "./routes/enterprise"; |
| 5618f9a | 59 | import seoRoutes from "./routes/seo"; |
| 05cdb85 | 60 | import versionRoutes from "./routes/version"; |
| f295f78 | 61 | import { platformStatus } from "./routes/platform-status"; |
| 52ad8b1 | 62 | import publicStatsRoutes from "./routes/public-stats"; |
| 63 | import demoRoutes from "./routes/demo"; | |
| 16b325c | 64 | import insightRoutes from "./routes/insights"; |
| 8d1483c | 65 | import doraRoutes from "./routes/dora"; |
| f1ab587 | 66 | import dashboardRoutes from "./routes/dashboard"; |
| 36b4cbd | 67 | import legalRoutes from "./routes/legal"; |
| 4b66018 | 68 | import legalDmcaRoutes from "./routes/legal/dmca"; |
| 69 | import legalTermsRoutes from "./routes/legal/terms"; | |
| 70 | import legalPrivacyRoutes from "./routes/legal/privacy"; | |
| 71 | import legalAcceptableUseRoutes from "./routes/legal/acceptable-use"; | |
| bdbd0de | 72 | import importRoutes from "./routes/import"; |
| 14c3cc8 | 73 | import importBulkRoutes from "./routes/import-bulk"; |
| f390cfa | 74 | import importSecretsRoutes from "./routes/import-secrets"; |
| bb2dea9 | 75 | import actionsImporterRoutes from "./routes/actions-importer"; |
| 14c3cc8 | 76 | import migrationRoutes from "./routes/migrations"; |
| 9a8b8de | 77 | import migrateRoutes from "./routes/migrate"; |
| 14c3cc8 | 78 | import specsRoutes from "./routes/specs"; |
| 23d0abf | 79 | import refactorRoutes from "./routes/refactors"; |
| 79136bb | 80 | import webRoutes from "./routes/web"; |
| 0316dbb | 81 | import hookRoutes from "./routes/hooks"; |
| 82 | import eventsRoutes from "./routes/events"; | |
| 83 | import passkeyRoutes from "./routes/passkeys"; | |
| 84 | import oauthRoutes from "./routes/oauth"; | |
| 85 | import developerAppsRoutes from "./routes/developer-apps"; | |
| 86 | import themeRoutes from "./routes/theme"; | |
| 87 | import auditRoutes from "./routes/audit"; | |
| 88 | import reactionRoutes from "./routes/reactions"; | |
| 89 | import savedReplyRoutes from "./routes/saved-replies"; | |
| 90 | import deploymentRoutes from "./routes/deployments"; | |
| 91 | import orgRoutes from "./routes/orgs"; | |
| 92 | import notificationRoutes from "./routes/notifications"; | |
| 93 | import onboardingRoutes from "./routes/onboarding"; | |
| 94 | import adminRoutes from "./routes/admin"; | |
| 7293c67 | 95 | import adminDeletionsRoutes from "./routes/admin-deletions"; |
| 96 | import adminStripeRoutes from "./routes/admin-stripe"; | |
| f764c07 | 97 | import adminDeploysRoutes from "./routes/admin-deploys"; |
| 98 | import adminDeploysPageRoutes from "./routes/admin-deploys-page"; | |
| 783dd46 | 99 | import adminServerTargetsRoutes from "./routes/admin-server-targets"; |
| 9aaa128 | 100 | import deployTargetsRoutes from "./routes/deploy-targets"; |
| 90c7531 | 101 | import claudeWebRoutes from "./routes/claude-web"; |
| 9dd96b9 | 102 | import adminOpsRoutes from "./routes/admin-ops"; |
| f2c00b4 | 103 | import adminSelfHostRoutes from "./routes/admin-self-host"; |
| 826eccf | 104 | import adminDiagnoseRoutes from "./routes/admin-diagnose"; |
| 509c376 | 105 | import adminIntegrationsRoutes from "./routes/admin-integrations"; |
| 79ed944 | 106 | import adminAdvancementRoutes from "./routes/admin-advancement"; |
| 0316dbb | 107 | import advisoriesRoutes from "./routes/advisories"; |
| 108 | import aiChangelogRoutes from "./routes/ai-changelog"; | |
| 109 | import aiExplainRoutes from "./routes/ai-explain"; | |
| 110 | import aiTestsRoutes from "./routes/ai-tests"; | |
| 111 | import askRoutes from "./routes/ask"; | |
| 38d31d3 | 112 | import repoChatRoutes from "./routes/repo-chat"; |
| ee7e577 | 113 | import personalChatRoutes from "./routes/personal-chat"; |
| 0316dbb | 114 | import billingRoutes from "./routes/billing"; |
| 8809b87 | 115 | import billingUsageRoutes from "./routes/billing-usage"; |
| 6778ad2 | 116 | import stripeWebhookRoutes from "./routes/stripe-webhook"; |
| 0316dbb | 117 | import codeScanningRoutes from "./routes/code-scanning"; |
| 118 | import commitStatusesRoutes from "./routes/commit-statuses"; | |
| 119 | import copilotRoutes from "./routes/copilot"; | |
| 120 | import depUpdaterRoutes from "./routes/dep-updater"; | |
| 121 | import depsRoutes from "./routes/deps"; | |
| 122 | import discussionsRoutes from "./routes/discussions"; | |
| 123 | import environmentsRoutes from "./routes/environments"; | |
| 4bbacbe | 124 | import previewsRoutes from "./routes/previews"; |
| 79ed944 | 125 | import docsTrackingRoutes from "./routes/docs-tracking"; |
| 0316dbb | 126 | import followsRoutes from "./routes/follows"; |
| 127 | import gatesRoutes from "./routes/gates"; | |
| 128 | import gistsRoutes from "./routes/gists"; | |
| 129 | import graphqlRoutes from "./routes/graphql"; | |
| 2c2163e | 130 | import mcpRoutes from "./routes/mcp"; |
| 0316dbb | 131 | import marketplaceRoutes from "./routes/marketplace"; |
| 5ca514a | 132 | import marketplaceAgentsRoutes from "./routes/marketplace-agents"; |
| 0316dbb | 133 | import mergeQueueRoutes from "./routes/merge-queue"; |
| 134 | import mirrorsRoutes from "./routes/mirrors"; | |
| 135 | import orgInsightsRoutes from "./routes/org-insights"; | |
| 136 | import packagesRoutes from "./routes/packages"; | |
| 137 | import packagesApiRoutes from "./routes/packages-api"; | |
| 845fd8a | 138 | import ociRegistryRoutes from "./routes/oci-registry"; |
| 0316dbb | 139 | import pagesRoutes from "./routes/pages"; |
| 140 | import projectsRoutes from "./routes/projects"; | |
| 141 | import protectedTagsRoutes from "./routes/protected-tags"; | |
| 142 | import pwaRoutes from "./routes/pwa"; | |
| 46d6165 | 143 | import installRoutes from "./routes/install"; |
| cd4f63b | 144 | import dxtRoutes from "./routes/dxt"; |
| 662ce86 | 145 | import connectClaudeRoutes from "./routes/connect-claude"; |
| ebbb527 | 146 | import claudeDeployRoutes from "./routes/claude-deploy"; |
| f5b9ef5 | 147 | import claudeIntegration from "./routes/claude-integration"; |
| 148 | import connectRoutes from "./routes/connect"; | |
| 05ab9b1 | 149 | import pushWatchRoutes from "./routes/push-watch"; |
| 150 | import orgSecretsRoutes from "./routes/org-secrets"; | |
| 0316dbb | 151 | import releasesRoutes from "./routes/releases"; |
| 152 | import requiredChecksRoutes from "./routes/required-checks"; | |
| 153 | import rulesetsRoutes from "./routes/rulesets"; | |
| 154 | import searchRoutes from "./routes/search"; | |
| 155 | import semanticSearchRoutes from "./routes/semantic-search"; | |
| 156 | import signingKeysRoutes from "./routes/signing-keys"; | |
| 157 | import sponsorsRoutes from "./routes/sponsors"; | |
| 158 | import ssoRoutes from "./routes/sso"; | |
| 46d6165 | 159 | import githubOauthRoutes from "./routes/github-oauth"; |
| 582cdac | 160 | import googleOauthRoutes from "./routes/google-oauth"; |
| 0316dbb | 161 | import symbolsRoutes from "./routes/symbols"; |
| 162 | import templatesRoutes from "./routes/templates"; | |
| 163 | import trafficRoutes from "./routes/traffic"; | |
| 164 | import wikisRoutes from "./routes/wikis"; | |
| 165 | import workflowsRoutes from "./routes/workflows"; | |
| 5ff9cc2 | 166 | import workflowArtifactsRoutes from "./routes/workflow-artifacts"; |
| 167 | import workflowSecretsRoutes from "./routes/workflow-secrets"; | |
| 46d6165 | 168 | import sleepModeRoutes from "./routes/sleep-mode"; |
| 56801e1 | 169 | import standupRoutes from "./routes/standups"; |
| 52ad8b1 | 170 | import vsGithubRoutes from "./routes/vs-github"; |
| 45f3b73 | 171 | import voiceRoutes from "./routes/voice-to-pr"; |
| 3122762 | 172 | import blogRoutes from "./routes/blog"; |
| cd4f63b | 173 | import playgroundRoutes from "./routes/playground"; |
| a2b3e99 | 174 | import crossRepoSearchRoutes from "./routes/cross-repo-search"; |
| 175 | import pushNotifRoutes from "./routes/push-notifications"; | |
| 9fbe6cd | 176 | import velocityRoutes from "./routes/velocity"; |
| 177 | import { staleBranchRoutes } from "./routes/stale-branches"; | |
| 22f43f3 | 178 | import pulseRoutes from "./routes/pulse"; |
| 74d8c4d | 179 | import healthScoreRoutes from "./routes/health-score"; |
| 180 | import hotFilesRoutes from "./routes/hot-files"; | |
| adf5e18 | 181 | import developerProgramRoutes from "./routes/developer-program"; |
| 891efbe | 182 | import shareRoutes from "./routes/share"; |
| 59b6fb2 | 183 | import { authRateLimit, gitRateLimit, searchRateLimit } from "./middleware/rate-limit"; |
| 184 | import { csrfToken, csrfProtect } from "./middleware/csrf"; | |
| f5b9ef5 | 185 | import { noCache } from "./middleware/no-cache"; |
| 79136bb | 186 | |
| 2316901 | 187 | import type { AuthEnv } from "./middleware/auth"; |
| bf19c50 | 188 | import { softAuth } from "./middleware/auth"; |
| 2316901 | 189 | |
| 190 | const app = new Hono<AuthEnv>(); | |
| 79136bb | 191 | |
| 3ef4c9d | 192 | // Request context (request ID, start time) runs before everything else |
| 193 | app.use("*", requestContext); | |
| 05b973e | 194 | // Middleware — compression first (wraps all responses) |
| 195 | app.use("*", compress()); | |
| f1ffd50 | 196 | |
| 197 | // ETag middleware — returns 304 Not Modified on unchanged responses. | |
| 198 | // Saves ~95% bandwidth on repeat visits. Skipped on git protocol + | |
| 199 | // SSE + the API surface where it would interfere with streaming. | |
| 200 | app.use("*", async (c, next) => { | |
| 201 | const p = c.req.path; | |
| 202 | if ( | |
| 203 | p.includes(".git/") || | |
| 204 | p.startsWith("/live-events") || | |
| 205 | p.startsWith("/api/events/deploy") || | |
| 3c03977 | 206 | p.startsWith("/admin/status") || |
| 207 | // PR live co-editing SSE stream — never etag streaming responses. | |
| 208 | /^\/api\/v2\/pulls\/[^/]+\/live(\/|$)/.test(p) | |
| f1ffd50 | 209 | ) { |
| 210 | return next(); | |
| 211 | } | |
| 212 | return etag()(c, next); | |
| 213 | }); | |
| 214 | ||
| 215 | // Cache-Control middleware — sets sensible defaults on public, anonymous | |
| 216 | // requests. Crontech (when wired as our edge layer) and downstream | |
| 217 | // browsers will honor these. Auth'd users get private,no-store | |
| 218 | // automatically — we never cache responses tied to a session. | |
| 219 | app.use("*", async (c, next) => { | |
| 220 | await next(); | |
| 221 | // Don't overwrite explicit headers set by route handlers — BUT the | |
| 222 | // ETag middleware unconditionally sets "private, no-cache, must- | |
| 223 | // revalidate" so we have to treat that specific value as "no | |
| 224 | // policy chosen yet" and apply ours. Any route that explicitly set | |
| 225 | // a different cache-control wins. | |
| 226 | const existing = c.res.headers.get("cache-control"); | |
| 227 | const etagDefault = | |
| 228 | existing === "private, no-cache, must-revalidate" || | |
| 229 | existing === "no-cache"; | |
| 230 | if (existing && !etagDefault) return; | |
| 231 | // Anything past auth: private + no-store (avoid leaking session | |
| 232 | // content into shared caches). softAuth runs before this on the | |
| 233 | // request, but the response side is what we're stamping. | |
| 234 | const hasSession = c.req.header("cookie")?.includes("session=") ?? false; | |
| 235 | const p = c.req.path; | |
| 236 | // Always private for known-authed paths regardless of cookie. | |
| 237 | if ( | |
| 238 | p.startsWith("/admin") || | |
| 239 | p.startsWith("/settings") || | |
| 240 | p.startsWith("/dashboard") || | |
| 241 | p.startsWith("/notifications") || | |
| 242 | p.startsWith("/connect/") || | |
| 243 | hasSession | |
| 244 | ) { | |
| 245 | c.res.headers.set("cache-control", "private, no-store"); | |
| 246 | return; | |
| 247 | } | |
| 248 | // Public marketing surfaces — short edge cache, longer browser cache, | |
| 249 | // stale-while-revalidate so the user never waits on a stale fetch. | |
| 250 | const isMarketing = | |
| 251 | p === "/" || | |
| 252 | p === "/features" || | |
| 253 | p === "/pricing" || | |
| 254 | p === "/about" || | |
| 255 | p === "/vs-github" || | |
| 256 | p === "/explore" || | |
| 257 | p === "/help" || | |
| 258 | p === "/changelog" || | |
| 9f29b65 | 259 | p === "/enterprise" || |
| f1ffd50 | 260 | p.startsWith("/legal/") || |
| 261 | p === "/terms" || | |
| 262 | p === "/privacy" || | |
| 263 | p === "/acceptable-use" || | |
| 264 | p.startsWith("/docs/"); | |
| 265 | if (isMarketing) { | |
| 266 | c.res.headers.set( | |
| 267 | "cache-control", | |
| 268 | "public, max-age=60, s-maxage=300, stale-while-revalidate=86400" | |
| 269 | ); | |
| 270 | return; | |
| 271 | } | |
| 272 | // Public repo browse pages — cache aggressively. Edge invalidates | |
| 273 | // on push via the post-receive hook (future Crontech surge purge). | |
| 274 | if (/^\/[^/]+\/[^/]+(\/.*)?$/.test(p) && c.req.method === "GET") { | |
| 275 | c.res.headers.set( | |
| 276 | "cache-control", | |
| 277 | "public, max-age=30, s-maxage=120, stale-while-revalidate=600" | |
| 278 | ); | |
| 279 | return; | |
| 280 | } | |
| 281 | // Default: don't cache anything we haven't explicitly opted in. | |
| 282 | c.res.headers.set("cache-control", "private, no-store"); | |
| 283 | }); | |
| 05b973e | 284 | // Logger only on non-git routes to avoid overhead on clone/push |
| 285 | app.use("*", async (c, next) => { | |
| 286 | if (c.req.path.includes(".git/")) return next(); | |
| 287 | return logger()(c, next); | |
| 288 | }); | |
| 79136bb | 289 | app.use("/api/*", cors()); |
| bf19c50 | 290 | // Global softAuth — populates c.get("user") for every downstream middleware |
| 291 | // + route. This was previously per-route, which meant rate-limit middleware | |
| 292 | // (and anything else inspecting auth state) always saw a null user. Keep | |
| 293 | // individual routes free to add requireAuth on top for hard gating; this | |
| 294 | // just establishes the user object cheaply. | |
| 295 | app.use("*", softAuth); | |
| 290ea77 | 296 | |
| 36cc17a | 297 | // Force-revalidate HTML on every request — kills browser cache holding stale |
| 290ea77 | 298 | // pre-redesign markup. JSON / static assets keep their own cache rules; only |
| 299 | // text/html responses get the no-cache stamp. Without this, every push to | |
| 300 | // main left users staring at cached 80s-looking pages from before the design | |
| 301 | // landed. | |
| 36cc17a | 302 | // |
| 303 | // We deliberately use `private, no-cache, must-revalidate` rather than | |
| 304 | // `no-store`. `no-store` disables Safari/Chrome's back-forward cache (bfcache), | |
| 305 | // which makes every Back/Forward press a cold server round-trip — that | |
| 306 | // contributed to the "every nav feels like a fresh login" UX complaint. | |
| 307 | // `no-cache` still revalidates on direct fetch but lets bfcache hold the | |
| 308 | // page in memory between navigations. | |
| 290ea77 | 309 | app.use("*", async (c, next) => { |
| 310 | await next(); | |
| 311 | const ct = c.res.headers.get("content-type") || ""; | |
| 312 | if (ct.startsWith("text/html")) { | |
| 36cc17a | 313 | c.header("cache-control", "private, no-cache, must-revalidate"); |
| 290ea77 | 314 | } |
| 315 | }); | |
| 826eccf | 316 | // Rate-limit API + auth endpoints. |
| 317 | // | |
| a41e675 | 318 | // `/api/*`: 1000/min per IP — generous so an admin clicking around the |
| 319 | // operator console (or a CDN/proxy concentrating multiple users behind one | |
| 320 | // IP) doesn't hit the wall. Bot-resistant headroom comes from the auth | |
| 321 | // rate limits below, not this one. | |
| 322 | // | |
| 323 | // `authedMultiplier` is set but only fires when an upstream middleware has | |
| 324 | // already populated c.get("user") — most app.use() chains apply softAuth | |
| 325 | // per-route, so the multiplier is best-effort. Keep the anonymous base | |
| 326 | // high enough that humans never feel it. | |
| 327 | // | |
| 328 | // Skip-paths: dashboard plumbing endpoints that the layout polls on a | |
| 329 | // fixed cadence and that we don't want consuming any bucket: | |
| 330 | // /api/version — layout polls every 15s | |
| 826eccf | 331 | // /api/notifications/count — nav bell unread-count fetcher |
| 332 | // /pwa/vapid-public-key — fetched once per push-notification opt-in | |
| 333 | app.use( | |
| 334 | "/api/*", | |
| a41e675 | 335 | rateLimit(1000, 60_000, "api", { |
| 826eccf | 336 | authedMultiplier: 4, |
| 337 | skipPaths: ["/api/version", "/api/notifications/count", "/pwa/vapid-public-key"], | |
| 338 | }) | |
| 339 | ); | |
| 0316dbb | 340 | app.use("/login", rateLimit(20, 60_000, "login")); |
| 341 | app.use("/register", rateLimit(10, 60_000, "register")); | |
| c63b860 | 342 | // BLOCK P1 — throttle forgot-password to deter enumeration + mail spam. |
| 343 | app.use("/forgot-password", rateLimit(5, 60_000, "forgot-password")); | |
| cd4f63b | 344 | // BLOCK Q2 — throttle magic-link sign-in for the same reason. |
| 345 | app.use("/login/magic", rateLimit(5, 60_000, "magic-link")); | |
| 79136bb | 346 | |
| 59b6fb2 | 347 | // CSRF protection — set token on all requests, validate on mutations |
| 348 | app.use("*", csrfToken); | |
| 349 | app.use("*", csrfProtect); | |
| 350 | ||
| 45e31d0 | 351 | // Rate limit auth routes |
| 352 | app.use("/login", authRateLimit); | |
| 353 | app.use("/register", authRateLimit); | |
| 354 | ||
| 59b6fb2 | 355 | // Rate limit git operations |
| 356 | app.use("/:owner/:repo.git/*", gitRateLimit); | |
| 357 | ||
| 358 | // Rate limit search | |
| 359 | app.use("/:owner/:repo/search", searchRateLimit); | |
| 360 | app.use("/explore", searchRateLimit); | |
| 79136bb | 361 | |
| f5b9ef5 | 362 | // No-cache for HTML — ensures browsers and proxies never serve stale pages. |
| 363 | // The middleware only stamps text/html responses so static assets keep | |
| 364 | // their own cache policies unchanged. | |
| 365 | app.use("*", noCache); | |
| 366 | ||
| 79136bb | 367 | // Git Smart HTTP protocol routes (must be before web routes) |
| 368 | app.route("/", gitRoutes); | |
| 369 | ||
| 45e31d0 | 370 | // REST API v1 (legacy) |
| 79136bb | 371 | app.route("/", apiRoutes); |
| 372 | ||
| 52ad8b1 | 373 | // Block L3 — /demo + /api/v2/demo/* live demo endpoints. Mounted BEFORE |
| 374 | // apiV2Routes so the /api/v2/demo/* JSON endpoints win over the v2 base | |
| 375 | // router's catch-shape, and BEFORE adminRoutes so the live /demo page | |
| 376 | // wins over the legacy /demo redirect in src/routes/admin.tsx. | |
| 377 | app.route("/", demoRoutes); | |
| 378 | ||
| 0316dbb | 379 | // REST API v2 (basePath /api/v2) |
| 380 | app.route("/", apiV2Routes); | |
| 381 | ||
| e75eddc | 382 | // Agent multiplayer v1 — /api/v2/agents/* (sessions, leases, usage). |
| 383 | // Mounted alongside apiV2Routes (its own basePath, no path conflict). | |
| 384 | app.route("/", agentsRoutes); | |
| 385 | ||
| ef3fd93 | 386 | // Multi-agent pipeline UI — /:owner/:repo/agents (list, new, live view). |
| 387 | // Must be before webRoutes (the catch-all) so the /agents sub-paths are | |
| 388 | // resolved before the generic tree/blob route takes over. | |
| 389 | app.route("/", agentPipelinesRoutes); | |
| 390 | ||
| ad6d4ad | 391 | // Inbound API hooks (GateTest callback + backup PAT-authed /api/v1/gate-runs) |
| 392 | app.route("/", hookRoutes); | |
| 21f8dbd | 393 | app.route("/api/events", eventsRoutes); |
| ad6d4ad | 394 | |
| 45e31d0 | 395 | // API documentation |
| 396 | app.route("/", apiDocsRoutes); | |
| 4a80519 | 397 | app.route("/", buildAgentSpecRoutes); |
| a6ff0f2 | 398 | // PR command center — global PR dashboard with AI/GateTest/auto-merge signal |
| 399 | app.route("/", pullsDashboardRoutes); | |
| e9aa4d8 | 400 | // Issue command center — global issue dashboard with AI-triage + autopilot signal |
| 401 | app.route("/", issuesDashboardRoutes); | |
| 402 | // Personal activity timeline — every event across the user's repos, with | |
| 403 | // AI-driven events surfaced separately (the Gluecron differentiator). | |
| 404 | app.route("/", activityRoutes); | |
| 405 | // Unified inbox — mentions + review requests + CI failures + AI events in one timeline | |
| 406 | app.route("/", inboxRoutes); | |
| 56801e1 | 407 | // AI standup feed — daily / weekly Claude-generated team brief |
| 408 | app.route("/", standupRoutes); | |
| 79136bb | 409 | |
| 410 | // Auth routes (register, login, logout) | |
| 411 | app.route("/", authRoutes); | |
| 412 | ||
| c63b860 | 413 | // BLOCK P1 — Password reset (forgot-password + reset-password) |
| 414 | app.route("/", passwordResetRoutes); | |
| 415 | ||
| 416 | // BLOCK P2 — Email verification (verify-email + resend) | |
| 417 | app.route("/", emailVerificationRoutes); | |
| 418 | ||
| cd4f63b | 419 | // BLOCK Q2 — Magic-link sign-in (/login/magic + callback) |
| 420 | app.route("/", magicLinkRoutes); | |
| 421 | ||
| 79136bb | 422 | // Settings routes (profile, SSH keys) |
| 423 | app.route("/", settingsRoutes); | |
| 424 | ||
| 7298a17 | 425 | // 2FA / TOTP settings (Block B4) |
| 426 | app.route("/", settings2faRoutes); | |
| 427 | ||
| e75eddc | 428 | // Agent multiplayer — /settings/agents management UI |
| 429 | app.route("/", settingsAgentsRoutes); | |
| 430 | ||
| 1d4ff60 | 431 | // Chat integrations — Slack / Discord / Teams (/settings/integrations |
| 432 | // + /api/v2/integrations/{slack,discord}/*). See src/lib/chat-bot.ts. | |
| 433 | app.route("/", settingsIntegrationsRoutes); | |
| 434 | app.route("/", integrationsChatRoutes); | |
| 435 | ||
| 2df1f8c | 436 | // WebAuthn / passkey routes (Block B5) |
| 437 | app.route("/", passkeyRoutes); | |
| 438 | ||
| 058d752 | 439 | // OAuth 2.0 provider (Block B6) |
| 440 | app.route("/", oauthRoutes); | |
| 441 | app.route("/", developerAppsRoutes); | |
| 442 | ||
| 6fc53bd | 443 | // Theme toggle (dark/light cookie) |
| 444 | app.route("/", themeRoutes); | |
| 445 | ||
| 446 | // Audit log UI | |
| 447 | app.route("/", auditRoutes); | |
| 448 | ||
| 449 | // Reactions API (issues, PRs, comments) | |
| 450 | app.route("/", reactionRoutes); | |
| 451 | ||
| 24cf2ca | 452 | // Saved replies (per-user canned comment templates) |
| 453 | app.route("/", savedReplyRoutes); | |
| 454 | ||
| 455 | // Environments + deployment history UI | |
| 456 | app.route("/", deploymentRoutes); | |
| 457 | ||
| 6563f0a | 458 | // Organizations + teams (Block B1) |
| 459 | app.route("/", orgRoutes); | |
| 460 | ||
| c81ab7a | 461 | // API tokens |
| 462 | app.route("/", tokenRoutes); | |
| 463 | ||
| 59b6fb2 | 464 | // Notifications |
| 3ef4c9d | 465 | app.route("/", notificationRoutes); |
| 466 | ||
| 79136bb | 467 | // Repo settings (description, visibility, delete) |
| 468 | app.route("/", repoSettings); | |
| 469 | ||
| 23d1a81 | 470 | // Repo collaborators (add/list/remove) |
| 471 | app.route("/", collaboratorRoutes); | |
| 472 | ||
| 04f6b7f | 473 | // Team-based repo collaborators (invite a whole team) |
| 474 | app.route("/", teamCollaboratorRoutes); | |
| 475 | ||
| 476 | // Collaborator invite accept flow (token-based) | |
| 477 | app.route("/", invitesRoutes); | |
| 478 | ||
| 479 | // Real-time SSE endpoint (topic-based live updates) | |
| 480 | app.route("/", liveEventsRoutes); | |
| 481 | ||
| 3c03977 | 482 | // PR live co-editing — presence + cursors + content sync via SSE. |
| 483 | app.route("/", prLiveRoutes); | |
| 484 | ||
| c81ab7a | 485 | // Webhooks management |
| 486 | app.route("/", webhookRoutes); | |
| 487 | ||
| 79136bb | 488 | // Compare view (branch diffs) |
| 489 | app.route("/", compareRoutes); | |
| 490 | ||
| 491 | // Issue tracker | |
| 492 | app.route("/", issueRoutes); | |
| 493 | ||
| cb5a796 | 494 | // Comment moderation queue — owner-only `/:owner/:repo/comments/pending` |
| 495 | // + per-row approve/reject/spam actions. Mounted before `pullRoutes` so | |
| 496 | // the `/:owner/:repo/comments/*` paths resolve before the broader PR | |
| 497 | // patterns kick in. | |
| 498 | app.route("/", commentModerationRoutes); | |
| 499 | ||
| 0074234 | 500 | // Pull requests |
| 501 | app.route("/", pullRoutes); | |
| 79ed944 | 502 | // PR sandboxes — runnable per-PR environments. Migration 0067. |
| 503 | app.route("/", prSandboxRoutes); | |
| 0074234 | 504 | |
| 9b3a183 | 505 | // Cloud dev environments — hosted VS Code in the browser. Migration 0072. |
| 506 | app.route("/", devEnvRoutes); | |
| 507 | ||
| c81ab7a | 508 | // Fork |
| 509 | app.route("/", forkRoutes); | |
| 510 | ||
| 0074234 | 511 | // Web file editor |
| 512 | app.route("/", editorRoutes); | |
| 513 | ||
| 43de941 | 514 | // Contributors |
| 515 | app.route("/", contributorRoutes); | |
| 516 | ||
| 699e5c7 | 517 | // Health liveness + metrics endpoints |
| 2c34075 | 518 | app.route("/", healthRoutes); |
| 519 | ||
| f295f78 | 520 | // Cross-product platform status (public, CORS-open — see docs/PLATFORM_STATUS.md) |
| 521 | app.route("/api/platform-status", platformStatus); | |
| 522 | ||
| 52ad8b1 | 523 | // Block L4 — Public stats counters (powers landing-page social proof) |
| 524 | app.route("/", publicStatsRoutes); | |
| 525 | ||
| 526 | // Block L3 — Live /demo page + /api/v2/demo/* endpoints | |
| 527 | app.route("/", demoRoutes); | |
| 528 | ||
| 2316be6 | 529 | // Public /status — human-readable platform health page |
| 530 | app.route("/", statusRoutes); | |
| 531 | ||
| b1be050 | 532 | // BLOCK S4 — Site-admin synthetic-monitor dashboard (/admin/status). |
| 533 | // Mounted near the public status route so the two surfaces are visible | |
| 534 | // side-by-side; routes are gated by isSiteAdmin internally. | |
| 535 | app.route("/", adminStatusRoutes); | |
| 536 | ||
| 80bed05 | 537 | // /help — quickstart + API cheatsheet |
| 538 | app.route("/", helpRoutes); | |
| 539 | ||
| e0e4219 | 540 | // /docs — expanded documentation site (getting started, workflow YAML, MCP, API, agents) |
| 541 | app.route("/", docsRoutes); | |
| 542 | ||
| 5f2e749 | 543 | // L8 — public /pricing page (free-tier polish). Mounted BEFORE marketing |
| 544 | // so the new editorial pricing layout wins the route; the legacy marketing | |
| 545 | // pricing remains as a safety net but is shadowed at the router. | |
| 546 | app.route("/", pricingRoutes); | |
| 547 | ||
| e1fc7db | 548 | // /changelog — manually curated platform release history |
| 549 | app.route("/", changelogRoutes); | |
| 550 | ||
| 9f29b65 | 551 | // Enterprise sales page + contact form lead capture. |
| 552 | app.route("/", enterpriseRoutes); | |
| 553 | ||
| b0148e9 | 554 | // /pricing, /features, /about — marketing surface |
| 555 | app.route("/", marketingRoutes); | |
| 556 | ||
| adf5e18 | 557 | // /developer-program — partner + marketplace revenue-share page |
| 558 | app.route("/", developerProgramRoutes); | |
| 559 | ||
| 5618f9a | 560 | // SEO: robots.txt + sitemap.xml |
| 561 | app.route("/", seoRoutes); | |
| 562 | ||
| 05cdb85 | 563 | // /api/version — live build SHA + uptime; client poller uses this to |
| 564 | // surface 'New version available — reload' banners on deploy. | |
| 565 | app.route("/", versionRoutes); | |
| 566 | ||
| 699e5c7 | 567 | // Health dashboard (per-repo health page) |
| 568 | app.route("/", healthDashboardRoutes); | |
| 569 | ||
| 9dd96b9 | 570 | // Block R1 — site-admin operations console. MUST be mounted BEFORE |
| 571 | // insightRoutes because its POST `/:owner/:repo/rollback` catch-all would | |
| 572 | // otherwise intercept `/admin/ops/rollback` (matching :owner=admin :repo=ops). | |
| 573 | app.route("/", adminOpsRoutes); | |
| f2c00b4 | 574 | // BLOCK W — Self-host status + bootstrap dashboard. |
| 575 | app.route("/", adminSelfHostRoutes); | |
| 826eccf | 576 | // BLOCK X — AI health-scan diagnose page (/admin/diagnose). |
| 577 | app.route("/", adminDiagnoseRoutes); | |
| 9dd96b9 | 578 | |
| 16b325c | 579 | // Insights (time-travel, dependencies, rollback) |
| 580 | app.route("/", insightRoutes); | |
| 581 | ||
| 8d1483c | 582 | // DORA metrics page (/:owner/:repo/insights/dora) |
| 583 | app.route("/", doraRoutes); | |
| 584 | ||
| f1ab587 | 585 | // Command center dashboard |
| 586 | app.route("/", dashboardRoutes); | |
| 587 | ||
| 36b4cbd | 588 | // Legal pages (terms, privacy, AUP) |
| 589 | app.route("/", legalRoutes); | |
| 4b66018 | 590 | // Long-form legal sub-pages — /legal/{terms,privacy,acceptable-use,dmca}. |
| 591 | // The main `legal.tsx` serves the short canonical paths (/terms, /privacy, | |
| 592 | // /acceptable-use); these are the formal versions that the legal pages | |
| 593 | // internally link to each other. | |
| 594 | app.route("/", legalTermsRoutes); | |
| 595 | app.route("/", legalPrivacyRoutes); | |
| 596 | app.route("/", legalAcceptableUseRoutes); | |
| 597 | app.route("/", legalDmcaRoutes); | |
| 36b4cbd | 598 | |
| bdbd0de | 599 | // GitHub import / migration |
| 600 | app.route("/", importRoutes); | |
| 14c3cc8 | 601 | app.route("/", importBulkRoutes); |
| f390cfa | 602 | app.route("/", importSecretsRoutes); |
| bb2dea9 | 603 | // GitHub Actions → Gluecron gates.yml importer (stateless converter) |
| 604 | app.route("/", actionsImporterRoutes); | |
| 14c3cc8 | 605 | app.route("/", migrationRoutes); |
| 9a8b8de | 606 | // GitHub Org Migration Wizard — live progress bulk importer |
| 607 | app.route("/", migrateRoutes); | |
| 14c3cc8 | 608 | |
| 609 | // Spec-to-PR (experimental AI-generated draft PRs) | |
| 610 | app.route("/", specsRoutes); | |
| 23d0abf | 611 | app.route("/", refactorRoutes); |
| bdbd0de | 612 | |
| c81ab7a | 613 | // Explore page |
| 614 | app.route("/", exploreRoutes); | |
| 615 | ||
| 59b6fb2 | 616 | // Onboarding |
| 617 | app.route("/", onboardingRoutes); | |
| 618 | ||
| 0316dbb | 619 | // Admin + feature routes |
| 620 | app.route("/", adminRoutes); | |
| 7293c67 | 621 | app.route("/", adminDeletionsRoutes); |
| 622 | app.route("/", adminStripeRoutes); | |
| 509c376 | 623 | app.route("/", adminIntegrationsRoutes); |
| 79ed944 | 624 | app.route("/", adminAdvancementRoutes); |
| f764c07 | 625 | app.route("/", adminDeploysRoutes); |
| 626 | app.route("/", adminDeploysPageRoutes); | |
| 783dd46 | 627 | app.route("/", adminServerTargetsRoutes); |
| 9aaa128 | 628 | app.route("/", deployTargetsRoutes); |
| 90c7531 | 629 | app.route("/", claudeWebRoutes); |
| 9dd96b9 | 630 | // Note: adminOpsRoutes is mounted earlier (before insightRoutes) — see comment above. |
| 0316dbb | 631 | app.route("/", advisoriesRoutes); |
| 632 | app.route("/", aiChangelogRoutes); | |
| 633 | app.route("/", aiExplainRoutes); | |
| 634 | app.route("/", aiTestsRoutes); | |
| 635 | app.route("/", askRoutes); | |
| 38d31d3 | 636 | app.route("/", repoChatRoutes); |
| ee7e577 | 637 | // Personal cross-repo chat — `/chat` (user-scoped). Mounted alongside |
| 638 | // repoChatRoutes so the two surfaces share the catch-all priority. | |
| 639 | app.route("/", personalChatRoutes); | |
| 0316dbb | 640 | app.route("/", billingRoutes); |
| 8809b87 | 641 | app.route("/", billingUsageRoutes); |
| 6778ad2 | 642 | app.route("/", stripeWebhookRoutes); |
| 0316dbb | 643 | app.route("/", codeScanningRoutes); |
| 644 | app.route("/", commitStatusesRoutes); | |
| 645 | app.route("/", copilotRoutes); | |
| 646 | app.route("/", depUpdaterRoutes); | |
| 647 | app.route("/", depsRoutes); | |
| 648 | app.route("/", discussionsRoutes); | |
| 649 | app.route("/", environmentsRoutes); | |
| 4bbacbe | 650 | app.route("/", previewsRoutes); |
| 79ed944 | 651 | app.route("/", docsTrackingRoutes); |
| 0316dbb | 652 | app.route("/", followsRoutes); |
| 653 | app.route("/", gatesRoutes); | |
| 654 | app.route("/", gistsRoutes); | |
| 655 | app.route("/", graphqlRoutes); | |
| 2c2163e | 656 | app.route("/", mcpRoutes); |
| 0316dbb | 657 | app.route("/", marketplaceRoutes); |
| 5ca514a | 658 | app.route("/", marketplaceAgentsRoutes); |
| 0316dbb | 659 | app.route("/", mergeQueueRoutes); |
| 660 | app.route("/", mirrorsRoutes); | |
| 661 | app.route("/", orgInsightsRoutes); | |
| 662 | app.route("/", packagesRoutes); | |
| 663 | app.route("/", packagesApiRoutes); | |
| 845fd8a | 664 | // OCI / Docker container registry — /v2/* (OCI Distribution Spec v1.0) |
| 665 | app.route("/", ociRegistryRoutes); | |
| 0316dbb | 666 | app.route("/", pagesRoutes); |
| 667 | app.route("/", projectsRoutes); | |
| 668 | app.route("/", protectedTagsRoutes); | |
| 669 | app.route("/", pwaRoutes); | |
| 46d6165 | 670 | app.route("/", installRoutes); |
| cd4f63b | 671 | // BLOCK Q1 — /gluecron.dxt download (Claude Desktop one-click extension) |
| 672 | app.route("/", dxtRoutes); | |
| 662ce86 | 673 | // Connect Claude — user-facing one-click MCP setup (/connect/claude). Mounted |
| 674 | // next to the other one-click flows (install.sh + .dxt) for surface symmetry. | |
| 675 | app.route("/", connectClaudeRoutes); | |
| f5b9ef5 | 676 | // Claude Code Integration Receiver — /api/claude/connect + /api/claude/session. |
| 677 | app.route("/", claudeIntegration); | |
| 678 | // Connect guide — public onboarding page (/connect/claude-guide). | |
| 679 | app.route("/", connectRoutes); | |
| 05ab9b1 | 680 | // Push Watch — per-commit live status (gates + deploy + latency) at /:owner/:repo/push/:sha |
| 681 | app.route("/", pushWatchRoutes); | |
| 682 | // Org Secrets Manager — BLOCK M2 — /orgs/:slug/settings/secrets | |
| 683 | app.route("/", orgSecretsRoutes); | |
| a2b3e99 | 684 | // Cross-repo code search — BLOCK M3 — /search/code + /api/search/code |
| 685 | app.route("/", crossRepoSearchRoutes); | |
| 686 | // Browser push notifications — BLOCK M4 — /settings/notifications/push + /api/push/* | |
| 687 | app.route("/", pushNotifRoutes); | |
| 9fbe6cd | 688 | // Developer Velocity Dashboard — BLOCK M9 — /:owner/:repo/insights/velocity |
| 689 | app.route("/", velocityRoutes); | |
| 690 | // Stale Branch Cleanup — BLOCK M10 — /:owner/:repo/branches/stale | |
| 691 | app.route("/", staleBranchRoutes); | |
| 22f43f3 | 692 | // Repository Pulse — BLOCK M12 — /:owner/:repo/pulse |
| 693 | app.route("/", pulseRoutes); | |
| 74d8c4d | 694 | // Repository Health Score — BLOCK M14 — /:owner/:repo/insights/health |
| 695 | app.route("/", healthScoreRoutes); | |
| 696 | // Hot Files Heatmap — BLOCK M16 — /:owner/:repo/insights/hotfiles | |
| 697 | app.route("/", hotFilesRoutes); | |
| ebbb527 | 698 | // Hosted Claude tool-use loops — paste loop, get endpoint, billing meter. |
| 699 | // See src/routes/claude-deploy.tsx + src/lib/hosted-claude-loop.ts. | |
| 700 | app.route("/", claudeDeployRoutes); | |
| 0316dbb | 701 | app.route("/", releasesRoutes); |
| 702 | app.route("/", requiredChecksRoutes); | |
| 703 | app.route("/", rulesetsRoutes); | |
| 704 | app.route("/", searchRoutes); | |
| 705 | app.route("/", semanticSearchRoutes); | |
| 706 | app.route("/", signingKeysRoutes); | |
| 707 | app.route("/", sponsorsRoutes); | |
| 708 | app.route("/", ssoRoutes); | |
| 46d6165 | 709 | app.route("/", githubOauthRoutes); |
| 582cdac | 710 | app.route("/", googleOauthRoutes); |
| 0316dbb | 711 | app.route("/", symbolsRoutes); |
| 712 | app.route("/", templatesRoutes); | |
| 713 | app.route("/", trafficRoutes); | |
| 714 | app.route("/", wikisRoutes); | |
| 715 | app.route("/", workflowsRoutes); | |
| 5ff9cc2 | 716 | app.route("/", workflowArtifactsRoutes); |
| 717 | app.route("/", workflowSecretsRoutes); | |
| 46d6165 | 718 | app.route("/", sleepModeRoutes); |
| 52ad8b1 | 719 | app.route("/", vsGithubRoutes); |
| 0316dbb | 720 | |
| 45f3b73 | 721 | // Voice-to-PR — phone-first dictation → spec or issue |
| 722 | app.route("/", voiceRoutes); | |
| 723 | ||
| 3122762 | 724 | // Blog / Devlog — public posts, no DB |
| 725 | app.route("/", blogRoutes); | |
| 726 | ||
| cd4f63b | 727 | // Block Q3 — Anonymous playground (`/play`, `/play/claim`). Mounted |
| 728 | // before the web catch-all so the bare `/play` literal wins over the | |
| 729 | // `/:owner` user-profile route. | |
| 730 | app.route("/", playgroundRoutes); | |
| 731 | ||
| 891efbe | 732 | // Shareable AI hours-saved OG image card + landing page. |
| 733 | // /share/hours-saved?user=:username → 1200×630 SVG (og:image) | |
| 734 | // /share/:username → HTML page with og:image meta + Twitter share | |
| 735 | // Mounted BEFORE webRoutes so /share/* doesn't fall through to the /:owner profile route. | |
| 736 | app.route("/", shareRoutes); | |
| 737 | ||
| 79136bb | 738 | // Web UI (catch-all, must be last) |
| 739 | app.route("/", webRoutes); | |
| 740 | ||
| c63b860 | 741 | // Global 404 — BLOCK O2 routes the shared `NotFoundPage` view so |
| 742 | // the markup stays consistent with /500 and the admin /403 page. | |
| 79136bb | 743 | app.notFound((c) => { |
| 36cc17a | 744 | const user = c.get("user") ?? null; |
| 79136bb | 745 | return c.html( |
| c63b860 | 746 | <NotFoundPage user={user} method={c.req.method} path={c.req.path} />, |
| 79136bb | 747 | 404 |
| 748 | ); | |
| 749 | }); | |
| 750 | ||
| c63b860 | 751 | // Global error handler — BLOCK O2 uses the shared `ServerErrorPage` |
| 752 | // view. Trace block only shown outside production. | |
| 79136bb | 753 | app.onError((err, c) => { |
| 80bed05 | 754 | reportError(err, { |
| 755 | requestId: c.get("requestId"), | |
| 756 | path: c.req.path, | |
| 757 | method: c.req.method, | |
| 758 | }); | |
| c63b860 | 759 | // Prefer the inbound `x-request-id` header (LB-supplied) and fall |
| 760 | // back to the context value set by request-context middleware. | |
| 761 | const requestId = | |
| 762 | c.req.header("x-request-id") || | |
| 763 | ((c.get("requestId" as never) as string | undefined) ?? undefined); | |
| 36cc17a | 764 | const user = c.get("user") ?? null; |
| c63b860 | 765 | const trace = |
| 766 | process.env.NODE_ENV !== "production" && err && err.message | |
| 767 | ? err.message | |
| 768 | : undefined; | |
| 79136bb | 769 | return c.html( |
| c63b860 | 770 | <ServerErrorPage user={user} requestId={requestId} trace={trace} />, |
| 79136bb | 771 | 500 |
| 772 | ); | |
| 773 | }); | |
| 774 | ||
| 775 | export default app; |