add more endpoints

This commit is contained in:
Devin Zuczek
2026-06-11 02:10:01 -04:00
parent 0fea1fff14
commit 4a97e05866
37 changed files with 55656 additions and 16 deletions
+31
View File
@@ -0,0 +1,31 @@
import { Hono } from 'hono'
import { useWorkersLogger } from 'workers-tagged-logger'
import { withNotFound, withOnError } from '@repo/hono-helpers'
import type { App } from './context'
import endpoints from '../static/endpoints.json'
/**
* Name-server / service-discovery worker served at the apex `rec.djdevin.net`.
* Returns the endpoints document the game client fetches to discover every
* service host. Static for now — this will be generated dynamically later.
*/
const app = new Hono<App>()
.use(
'*',
// middleware
(c, next) =>
useWorkersLogger(c.env.NAME, {
environment: c.env.ENVIRONMENT,
release: c.env.SENTRY_RELEASE,
})(c, next)
)
.onError(withOnError())
.notFound(withNotFound())
// Endpoints document. TODO: generate this dynamically per environment.
.get('/', (c) => c.json(endpoints))
export default app