15 lines
330 B
TypeScript
15 lines
330 B
TypeScript
const BACKEND_URL = process.env.BACKEND_URL;
|
|
|
|
export async function GET() {
|
|
const response = await fetch(`${BACKEND_URL}/users/user`);
|
|
|
|
if (!response.ok) {
|
|
return new Response("Request failed in backend", {
|
|
status: response.status,
|
|
});
|
|
}
|
|
|
|
const data = await response.json();
|
|
|
|
return Response.json(data);
|
|
}
|