Add test endpoints
This commit is contained in:
parent
1df769777a
commit
7365ff107c
2 changed files with 26 additions and 0 deletions
12
frontend/src/pages/api/test-debug.ts
Normal file
12
frontend/src/pages/api/test-debug.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
import type { APIRoute } from 'astro';
|
||||||
|
|
||||||
|
export const GET: APIRoute = async ({ request }) => {
|
||||||
|
return new Response(JSON.stringify({
|
||||||
|
url: request.url,
|
||||||
|
method: request.method,
|
||||||
|
headers: Object.fromEntries(request.headers.entries()),
|
||||||
|
}), {
|
||||||
|
status: 200,
|
||||||
|
headers: { 'Content-Type': 'application/json' }
|
||||||
|
});
|
||||||
|
};
|
||||||
14
frontend/src/pages/api/test-post.ts
Normal file
14
frontend/src/pages/api/test-post.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
import type { APIRoute } from 'astro';
|
||||||
|
|
||||||
|
export const POST: APIRoute = async ({ request, url }) => {
|
||||||
|
const params = Object.fromEntries(url.searchParams.entries());
|
||||||
|
|
||||||
|
return new Response(JSON.stringify({
|
||||||
|
method: 'POST',
|
||||||
|
params,
|
||||||
|
url: request.url,
|
||||||
|
}), {
|
||||||
|
status: 200,
|
||||||
|
headers: { 'Content-Type': 'application/json' }
|
||||||
|
});
|
||||||
|
};
|
||||||
Loading…
Add table
Add a link
Reference in a new issue