1
2
3
4
5
6
7
8
9
export async function testApi(request: Request): Promise<Response> {
if (request.method !== "POST") {
return Response.json({
error: "Method not allowed",
}, { status: 405 });
}
const body = await request.json();
return Response.json({ message: `You said: ${body.text}` });
}