Fixed partial handling and added cookies

This commit is contained in:
Kevin FEDYNA
2025-01-21 16:09:36 +01:00
parent b364f6cbab
commit fa66621abc
12 changed files with 158 additions and 48 deletions
+22
View File
@@ -0,0 +1,22 @@
import { Handlers } from "$fresh/server.ts";
export const handler: Handlers = {
async POST(request, context) {
if (request.headers.get("content-type") != "application/json") {
return new Response(null, {
status: 400,
});
}
const responseBody = {
requestBody: await request.json(),
context,
};
return new Response(JSON.stringify(responseBody), {
headers: {
"content-type": "application/json",
},
});
},
};