19 lines
488 B
TypeScript
19 lines
488 B
TypeScript
import type { RequestHandler } from "./$types";
|
|
|
|
export const POST: RequestHandler = async ({ request, locals }) => {
|
|
const data = await request.json();
|
|
const { fastifyURL } = locals;
|
|
|
|
const response = await fetch(fastifyURL + "/get-all-comments", {
|
|
method: "POST",
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
},
|
|
body: JSON.stringify(data),
|
|
});
|
|
|
|
const output = await response.json();
|
|
|
|
return new Response(JSON.stringify(output));
|
|
};
|