The recipes.blue monorepo recipes.blue
recipes appview atproto

fix: resolve client metadata in hono

Changed files
+10 -1
apps
api
src
+10 -1
apps/api/src/index.ts
··· 61 61 }); 62 62 63 63 app.use('/*', async (ctx, next) => { 64 - if (ctx.finalized) return next(); 64 + if (ctx.req.path == '/client-metadata.json') { 65 + let path = getFilePathWithoutDefaultDocument({ 66 + filename: 'client-metadata.json', 67 + root: env.PUBLIC_DIR, 68 + }); 69 + 70 + const metadata = JSON.parse(readFileSync(`./${path}`).toString()); 71 + return ctx.json(metadata); 72 + } 65 73 74 + if (ctx.finalized) return next(); 66 75 let path = getFilePathWithoutDefaultDocument({ 67 76 filename: 'index.html', 68 77 root: env.PUBLIC_DIR,