Initial commit
This commit is contained in:
commit
78f8d225ee
21173 changed files with 2907774 additions and 0 deletions
25
app/api/bgremove/methods/route.ts
Normal file
25
app/api/bgremove/methods/route.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
export const runtime = "nodejs";
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
const BGBYE_URL =
|
||||
process.env.BGBYE_URL ||
|
||||
process.env.BG_BYE_URL ||
|
||||
process.env.BGREMOVER_BASE_URL ||
|
||||
"http://bgbye:7001";
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const r = await fetch(`${BGBYE_URL}/methods`, { cache: "no-store" });
|
||||
const body = await r.text();
|
||||
return new Response(body, {
|
||||
status: r.status,
|
||||
headers: { "content-type": r.headers.get("content-type") || "application/json" },
|
||||
});
|
||||
} catch {
|
||||
return new Response(JSON.stringify({ methods: [] }), {
|
||||
status: 200,
|
||||
headers: { "content-type": "application/json" },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue