add some (maybe) working storefronts

This commit is contained in:
Devin Zuczek
2026-07-06 22:14:08 -04:00
parent baf43bfe31
commit 3c308d27f0
21 changed files with 52799 additions and 27389 deletions
+8 -4
View File
@@ -6,7 +6,6 @@ import { withNotFound, withOnError } from '@repo/hono-helpers'
import defaultAvatarItems from '../static/default-avatar-items.json'
import defaultAvatar from '../static/default-avatar.json'
import myProgress from '../static/my-progress.json'
import storefrontGiftDrop3 from '../static/storefronts-v3-giftdropstore-3.json'
import weeklyChallenge from '../static/weekly-challenge.json'
import { getAvatar, setAvatar } from './avatar-db'
import { validateAndGetAccountId } from './jwt'
@@ -218,9 +217,14 @@ const app = new Hono<App>()
])
})
// Gift-drop storefront. Falls back to the bundled static catalog when no
// storefront row exists.
.get('/api/storefronts/v3/giftdropstore/3', (c) => c.json(storefrontGiftDrop3))
// Gift-drop storefront. Serves `static/storefronts/sf{id}.json` for the requested
// storefront id via the ASSETS binding; 404s when no such catalog exists.
.get('/api/storefronts/v3/giftdropstore/:id', async (c) => {
const id = c.req.param('id')
const res = await c.env.ASSETS.fetch(new URL(`/sf${id}.json`, c.req.url))
if (!res.ok) return c.notFound()
return c.json(await res.json())
})
// Current weekly challenge. Served from the bundled static JSON until
// per-rotation challenge data is wired up.