release: WRNexusJS 0.8.0
This commit is contained in:
@@ -8,6 +8,11 @@ export const GET = async () => {
|
||||
};
|
||||
|
||||
export const POST = async (ctx: Context) => {
|
||||
const body = await ctx.req.json();
|
||||
const body = await ctx.req.json().catch(() => undefined);
|
||||
if (body === undefined)
|
||||
return Response.json(
|
||||
{ error: "Request body must be valid JSON." },
|
||||
{ status: 400, headers: { "cache-control": "no-store" } },
|
||||
);
|
||||
return Response.json({ received: body });
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user