404 NOT_FOUND for FastAPI Deployment

Hi. I tried to deploy our backend ( FastAPI) on vercel but all I get is “404 NOT FOUND”.
It is remarkable, that the deployment went thru and is green, but there are absolutly no runtime logs available.

So I even can’t see what is failing.

Currently, I host the fastapi selfhosted on a Hetzner node using Docker and everything works fine. Since our frontend is hosted on Vercel, i want to migrate the backend also to vercel to reduce latencies.

However, it is not working and I have no utils to debug it somehow because no logs are available.

Ccan someone give me some hints? Has someone already tried it and made fastapi work on FastAPI? Any useful tips are much appreciated. Thank you.

vercel.json:

{
  "builds": [
    {
      "src": "api/main.py",
      "use": "@vercel/python"
    }
  ],
  "routes": [
    {
      "src": "/(.*)",
      "dest": "api/main.py"
    }
  ]
}

There’s another community post with 404 debugging tips that might be helpful. Please give these solutions a try and let us know how it goes.

A human should be around soon to offer more advice. But you can also get helpful information quickly by asking v0.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.