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 defaultAvatarItems from '../static/default-avatar-items.json'
/**
* Economy Worker. Hosts the avatar/economy endpoints the game client calls on
* the `econ` service (these are separate from the main `api` worker). DB-backed
* data is stubbed for now — no bindings yet.
*/
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())
// Default-unlocked avatar items, served from the bundled static JSON.
.get('/api/avatar/v1/defaultunlocked', (c) => c.json(defaultAvatarItems))
export default app