mirror of
https://github.com/djdevin/recflare.git
synced 2026-09-08 22:51:30 -07:00
testing generic deploy
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user