Next.js Discord

Discord Forum

Vite Proxy vercel.json rewrite how to correctly configure this

Answered
American black bear posted this in #help-forum
Open in Discord
American black bearOP
Im close to complete this but cant take rest of content after /api to my server url
for example [frontend_url]/api/123 -> {backend_url/api/123]
MY current solution makes [frontend_url]/api/123 -> {backend_url/api]

{
"rewrites": [
{
"source": "/api/(.)",
"destination": "http://ec2-xx-xxx-xxx-xxx.eu-north-1.compute.amazonaws.com:8000/accounts/
"
},
]
}
Answered by American black bear
But already fixed it
View full answer

7 Replies

American black bearOP
I know its communicate with my server because I got typical message for my
I think it because its connectiing /api not /api/123
I read on docs :path example but really do not work for me idkk why maybe Im making mistake somewhere?
American black bearOP
its vite react
not next.js
I just deployed on vercel
American black bearOP
But already fixed it
Answer