mirror of
https://github.com/djdevin/recflare.git
synced 2026-09-08 14:41:28 -07:00
remove hard coded routes
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user