mirror of
https://github.com/djdevin/recflare.git
synced 2026-09-08 06:31:27 -07:00
testing generic deploy
This commit is contained in:
+9
-7
@@ -1,20 +1,22 @@
|
||||
# ns
|
||||
|
||||
Name-server / service-discovery worker served at `ns.rec.djdevin.net`.
|
||||
Name-server / service-discovery worker served on the `ns` subdomain.
|
||||
|
||||
`GET /` returns the endpoints document the game client fetches on startup to
|
||||
discover every service host (Accounts, API, Auth, Econ, Matchmaking,
|
||||
Notifications, …).
|
||||
|
||||
The document is served from `static/endpoints.json` (a snapshot downloaded from
|
||||
the live host). **It will be generated dynamically eventually** — e.g. per
|
||||
environment / from the deployed routes — at which point the static file goes
|
||||
away.
|
||||
The document is served from `static/endpoints.json`, whose hosts are generated
|
||||
from the repo-root `env.json` by `runx sync` — every entry is derived from the
|
||||
configured base `domain`.
|
||||
|
||||
## Updating the snapshot
|
||||
## Updating endpoints
|
||||
|
||||
Change `domain` in `env.json` (or edit the host map in `static/endpoints.json`),
|
||||
then regenerate:
|
||||
|
||||
```sh
|
||||
curl -sS https://rec.djdevin.net/ -o apps/ns/static/endpoints.json
|
||||
just sync
|
||||
```
|
||||
|
||||
(Bundled at build time, so a redeploy is required for changes to take effect.)
|
||||
|
||||
@@ -8,9 +8,10 @@ import endpoints from '../static/endpoints.json'
|
||||
import type { App } from './context'
|
||||
|
||||
/**
|
||||
* Name-server / service-discovery worker served at the apex `rec.djdevin.net`.
|
||||
* Name-server / service-discovery worker served at the apex domain.
|
||||
* Returns the endpoints document the game client fetches to discover every
|
||||
* service host. Static for now — this will be generated dynamically later.
|
||||
* service host. Generated from `env.json` by `runx sync` — run it after
|
||||
* changing the domain (see `apps/ns/static/endpoints.json`).
|
||||
*/
|
||||
const app = new Hono<App>()
|
||||
.use(
|
||||
|
||||
@@ -2,17 +2,16 @@ import { exports } from 'cloudflare:workers'
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import '../../ns.app'
|
||||
import endpoints from '../../../static/endpoints.json'
|
||||
|
||||
const ORIGIN = 'https://ns.rec.djdevin.net'
|
||||
const ORIGIN = 'https://example.com'
|
||||
|
||||
describe('ns endpoints', () => {
|
||||
test('GET / returns the endpoints document', async () => {
|
||||
const res = await exports.default.fetch(`${ORIGIN}/`)
|
||||
expect(res.status).toBe(200)
|
||||
const body = (await res.json()) as Record<string, string>
|
||||
expect(body.API).toBe('https://api.rec.djdevin.net')
|
||||
expect(body.Notifications).toBe('https://notify.rec.djdevin.net')
|
||||
expect(body.Econ).toBe('https://econ.rec.djdevin.net')
|
||||
const body = await res.json()
|
||||
expect(body).toEqual(endpoints)
|
||||
})
|
||||
|
||||
test('unknown path returns 404', async () => {
|
||||
|
||||
@@ -1,38 +1,38 @@
|
||||
{
|
||||
"Accounts": "https://accounts.rec.djdevin.net",
|
||||
"AI": "https://ai.rec.djdevin.net",
|
||||
"API": "https://api.rec.djdevin.net",
|
||||
"Auth": "https://auth.rec.djdevin.net",
|
||||
"BugReporting": "https://bugreporting.rec.djdevin.net",
|
||||
"Cards": "https://cards.rec.djdevin.net",
|
||||
"CDN": "https://cdn.rec.djdevin.net",
|
||||
"Chat": "https://chat.rec.djdevin.net",
|
||||
"Clubs": "https://clubs.rec.djdevin.net",
|
||||
"CMS": "https://cms.rec.djdevin.net",
|
||||
"Commerce": "https://commerce.rec.djdevin.net",
|
||||
"Data": "https://data.rec.djdevin.net",
|
||||
"DataCollection": "https://datacollection.rec.djdevin.net",
|
||||
"Discovery": "https://discovery.rec.djdevin.net",
|
||||
"Econ": "https://econ.rec.djdevin.net",
|
||||
"GameLogs": "https://gamelogs.rec.djdevin.net",
|
||||
"Geo": "https://geo.rec.djdevin.net",
|
||||
"Images": "https://img.rec.djdevin.net",
|
||||
"Leaderboard": "https://leaderboard.rec.djdevin.net",
|
||||
"Link": "https://link.rec.djdevin.net",
|
||||
"Lists": "https://lists.rec.djdevin.net",
|
||||
"Matchmaking": "https://match.rec.djdevin.net",
|
||||
"Moderation": "https://api.rec.djdevin.net",
|
||||
"Notifications": "https://notify.rec.djdevin.net",
|
||||
"PlatformNotifications": "https://platformnotifications.rec.djdevin.net",
|
||||
"PlayerSettings": "https://playersettings.rec.djdevin.net",
|
||||
"RoomComments": "https://roomcomments.rec.djdevin.net",
|
||||
"RoomieIntegrations": "https://roomieintegrations.rec.djdevin.net",
|
||||
"Rooms": "https://rooms.rec.djdevin.net",
|
||||
"Storage": "https://storage.rec.djdevin.net",
|
||||
"Strings": "https://strings.rec.djdevin.net",
|
||||
"StringsCDN": "https://strings-cdn.rec.djdevin.net",
|
||||
"Studio": "https://studio.rec.djdevin.net",
|
||||
"Thorn": "https://thorn.rec.djdevin.net",
|
||||
"Videos": "https://videos.rec.djdevin.net",
|
||||
"WWW": "https://www.rec.djdevin.net"
|
||||
"Accounts": "https://accounts.rec.example.com",
|
||||
"AI": "https://ai.rec.example.com",
|
||||
"API": "https://api.rec.example.com",
|
||||
"Auth": "https://auth.rec.example.com",
|
||||
"BugReporting": "https://bugreporting.rec.example.com",
|
||||
"Cards": "https://cards.rec.example.com",
|
||||
"CDN": "https://cdn.rec.example.com",
|
||||
"Chat": "https://chat.rec.example.com",
|
||||
"Clubs": "https://clubs.rec.example.com",
|
||||
"CMS": "https://cms.rec.example.com",
|
||||
"Commerce": "https://commerce.rec.example.com",
|
||||
"Data": "https://data.rec.example.com",
|
||||
"DataCollection": "https://datacollection.rec.example.com",
|
||||
"Discovery": "https://discovery.rec.example.com",
|
||||
"Econ": "https://econ.rec.example.com",
|
||||
"GameLogs": "https://gamelogs.rec.example.com",
|
||||
"Geo": "https://geo.rec.example.com",
|
||||
"Images": "https://img.rec.example.com",
|
||||
"Leaderboard": "https://leaderboard.rec.example.com",
|
||||
"Link": "https://link.rec.example.com",
|
||||
"Lists": "https://lists.rec.example.com",
|
||||
"Matchmaking": "https://match.rec.example.com",
|
||||
"Moderation": "https://api.rec.example.com",
|
||||
"Notifications": "https://notify.rec.example.com",
|
||||
"PlatformNotifications": "https://platformnotifications.rec.example.com",
|
||||
"PlayerSettings": "https://playersettings.rec.example.com",
|
||||
"RoomComments": "https://roomcomments.rec.example.com",
|
||||
"RoomieIntegrations": "https://roomieintegrations.rec.example.com",
|
||||
"Rooms": "https://rooms.rec.example.com",
|
||||
"Storage": "https://storage.rec.example.com",
|
||||
"Strings": "https://strings.rec.example.com",
|
||||
"StringsCDN": "https://strings-cdn.rec.example.com",
|
||||
"Studio": "https://studio.rec.example.com",
|
||||
"Thorn": "https://thorn.rec.example.com",
|
||||
"Videos": "https://videos.rec.example.com",
|
||||
"WWW": "https://www.rec.example.com"
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"compatibility_flags": ["nodejs_compat"],
|
||||
"routes": [
|
||||
{
|
||||
"pattern": "ns.rec.djdevin.net",
|
||||
"pattern": "ns.rec.example.com",
|
||||
"custom_domain": true
|
||||
}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user