FastAPI with nextjs pages App

Hey, I am using the t3 stack and trying to setup a fastapi inside of it as i need it for some ML stuff. I came across this https://github.com/digitros/nextjs-fastapi however it only works with app dir. Ideally i dont wont unrestricted access to this api either, i want to try limit its access to only being used from interally via trpc.
GitHub
GitHub - digitros/nextjs-fastapi
Contribute to digitros/nextjs-fastapi development by creating an account on GitHub.
1 Reply
WOLFLEADER
WOLFLEADEROP15mo ago
I have tried
rewrites: async () => {
return [
{
source: "/api/py/:path*",
destination:
process.env.NODE_ENV === "development"
? "http://127.0.0.1:8000/api/:path*"
: "/api/py",
},
];
},
rewrites: async () => {
return [
{
source: "/api/py/:path*",
destination:
process.env.NODE_ENV === "development"
? "http://127.0.0.1:8000/api/:path*"
: "/api/py",
},
];
},
however when i go to localhost:3000/api/py it doesnt redirect me
Want results from more Discord servers?
Add your server