Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/danielroe/roe.dev. This is the code and content for my personal website, built in Nuxt. roe.dev
Something went wrong. Try again.
TypeScript
at feat/sentry
1234567891011121314export default defineEventHandler(async event => { if (event.method === 'OPTIONS') return null const sanity = useSanity(event)
assertMethod(event, 'POST') const { question } = await readBody(event) if (!question) throw createError({ statusCode: 422 })
event.waitUntil(sanity.client.create({ _type: 'ama', content: question }).catch(console.error))
await sendEmail(event, 'Anonymous question', question) return null})