log body in webhook

master
TZGyn 10 months ago
parent adbf766eb3
commit 72ca2647a9
Signed by: TZGyn
GPG Key ID: 122EAF77AE81FD4A

@ -4,11 +4,15 @@ import { z } from 'zod'
export const POST = async ({ locals, request }) => {
const type = request.headers.get('Content-Type')
console.log(type)
if (type !== 'application/json') return new Response()
console.log('Type:', type)
if (type !== 'application/json; charset=utf-8') {
return new Response()
}
const body = await request.json()
console.log('Body:', body)
const flatSchema = z.object({
type: z.literal('Flat'),
key: z.string(),

Loading…
Cancel
Save