Next.js Discord

Discord Forum

Python serverless function returns 404 in local, but fine in prod

Unanswered
German Roughhaired Pointer posted this in #help-forum
Open in Discord
Avatar
German Roughhaired PointerOP
This is more of a Vercel question. I followed the instructions [here](https://vercel.com/docs/functions/runtimes/python) to set up a serverless Python function. I am not using any server frameworks, just plain Python http server. It works fine in production, but when I run it locally (through vercel dev), it returns 404. How to fix it?

My file structure
app
api
| venmo.py
requirements.txt
vercel.json

// requirements.txt
venmo-api==0.3.1

// vercel.json
{
  "buildCommand": "npx convex deploy --cmd 'npm run build'",
  "installCommand": "npm install --legacy-peer-deps",
  "functions": {
    "api/**": {
      "excludeFiles": "{.next,*.cache,node_modules,public,app}/**"
    }
  }
}

0 Replies