Added pass-through API between Next and Python.

pull/2094/head
Herr Turing 2 months ago
parent 55ad58bfd3
commit 2baba6ada4

@ -15,6 +15,6 @@ services:
- ./frontend/app:/app/app/
- ./frontend/public:/app/public
ports:
- 8180:3000
- 3000:3000
depends_on:
- api

@ -0,0 +1,17 @@
export async function POST(req: Request) {
const data = await req.json();
const { username, sites, withNSFW } = data;
return await fetch("http://api:8000", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
usernames: [username],
sites,
f: ["nsfw"]
})
});
}
Loading…
Cancel
Save