Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ const handler = async (request: Request): Promise<Response> => {

if (request.method === "GET") {
// GET リクエストの場合は、クエリパラメータを返す
const data = JSON.stringify({ pathname, search }, null, 2);
const data = JSON.stringify({ pathname, search, test: true }, null, 2);
console.log("Request Data:", data);
return new Response(data, {
headers: { "Content-Type": "application/json" },
});
} else if (request.method === "POST") {
// POST リクエストの場合は、リクエストボディを返す
const payload = await request.text();
const data = JSON.stringify({ pathname, payload }, null, 2);
const data = JSON.stringify({ pathname, payload, test: true }, null, 2);
console.log("Request Data:", data);
return new Response(data, {
headers: { "Content-Type": "application/json" },
});
}
return new Response("Not Found", { status: 404 });
return new Response("[TEST] Not Found", { status: 404 });
};

console.log(`Listening on http://localhost:${PORT}/`);
Expand Down