remove hard coded routes

This commit is contained in:
Devin Zuczek
2026-06-29 22:41:17 -04:00
parent 69b89e2dc4
commit 81815ef06c
29 changed files with 122 additions and 256 deletions
+5 -1
View File
@@ -174,7 +174,11 @@ const app = new Hono<App>({ strict: false })
VersionRegex: '.*',
})
)
.get('/api/config/v2', (c) => c.json(apiConfigV2))
// ShareBaseUrl is derived from the deploy-time base domain; the rest of the
// config is static.
.get('/api/config/v2', (c) =>
c.json({ ...apiConfigV2, ShareBaseUrl: `https://www.${c.env.DOMAIN}/{0}` })
)
.get('/api/versioncheck/v4', (c) =>
c.json({
VersionStatus: 0,
+6
View File
@@ -2,6 +2,12 @@ import type { HonoApp } from '@repo/hono-helpers'
import type { SharedHonoEnv, SharedHonoVariables } from '@repo/hono-helpers/src/types'
export type Env = SharedHonoEnv & {
/**
* Base domain the share-link URL is derived from, e.g. `rec.example.com`.
* Injected at deploy time via `--var DOMAIN`; defaults in `wrangler.jsonc`
* for local dev and tests.
*/
DOMAIN: string
// Shared rooms database (schema/migrations owned by the `rooms` worker). Used
// read-only here for the /roomserver/rooms/* endpoints.
DB: D1Database
+2 -7
View File
@@ -4,12 +4,6 @@
"main": "src/api.app.ts",
"compatibility_date": "2025-09-20",
"compatibility_flags": ["nodejs_compat"],
"routes": [
{
"pattern": "api.rec.example.com",
"custom_domain": true
}
],
// Shared rooms DB (created + migrated by the `rooms` worker; bound read-only here).
"d1_databases": [
{
@@ -36,6 +30,7 @@
},
"vars": {
"ENVIRONMENT": "development", // overridden during deployment
"SENTRY_RELEASE": "unknown" // overridden during deployment
"SENTRY_RELEASE": "unknown", // overridden during deployment
"DOMAIN": "rec.example.com" // base domain; overridden during deployment
}
}