|
| 1 | +import { |
| 2 | + createApiRoutes, |
| 3 | + createAuthenticatedApiRoutes, |
| 4 | +} from "@shared/apiRoutes.ts"; |
1 | 5 | import { createAppConfig } from "@shared/appConfig.ts"; |
2 | 6 | import { createAppConfigMiddleware } from "@shared/appConfigMiddleware.ts"; |
3 | 7 | import type { AppVariables } from "@shared/appVariables.ts"; |
4 | 8 | import { systemClock } from "@shared/clock.ts"; |
5 | 9 | import { createClockMiddleware } from "@shared/clockMiddleware.ts"; |
6 | 10 | import { createLoggerMiddleware } from "@shared/loggerMiddleware.ts"; |
| 11 | +import { |
| 12 | + createAuthenticatedPageRoutes, |
| 13 | + createPageRoutes, |
| 14 | +} from "@shared/pageRoutes.ts"; |
| 15 | +import { pageRoutes } from "@shared/routes"; |
7 | 16 | import { createStructuredLogger } from "@shared/structuredLogger.ts"; |
8 | 17 | import { addUser } from "@shared/user.ts"; |
9 | 18 | import { randomUUIDv7 } from "bun"; |
| 19 | +import { roundToNearestHours } from "date-fns"; |
10 | 20 | import { type Context, Hono } from "hono"; |
11 | 21 | import { serveStatic } from "hono/bun"; |
12 | 22 | import { cors } from "hono/cors"; |
13 | 23 | import { csrf } from "hono/csrf"; |
14 | 24 | import { jwt } from "hono/jwt"; |
15 | 25 | import { requestId } from "hono/request-id"; |
16 | 26 | import { secureHeaders } from "hono/secure-headers"; |
17 | | -import { |
18 | | - createApiRoutes, |
19 | | - createAuthenticatedApiRoutes, |
20 | | -} from "./shared/apiRoutes.ts"; |
21 | | -import { |
22 | | - createAuthenticatedPageRoutes, |
23 | | - createPageRoutes, |
24 | | -} from "./shared/pageRoutes.ts"; |
25 | 27 |
|
26 | 28 | // temporary user |
27 | 29 | // will be removed when IDP is hooked up |
@@ -60,7 +62,7 @@ const app = new Hono<{ Variables: AppVariables }>() |
60 | 62 | .route("/api", createAuthenticatedApiRoutes(jwtMiddleware)) |
61 | 63 | // Page routes |
62 | 64 | .get("/", (c) => { |
63 | | - return c.redirect("/auth/home"); |
| 65 | + return c.redirect(pageRoutes.HOME); |
64 | 66 | }) |
65 | 67 | .route("/", createPageRoutes()) |
66 | 68 | .route("/", createAuthenticatedPageRoutes(jwtMiddleware)); |
|
0 commit comments