Search code examples
node.jsdeploymentverceladonis.js

How to deploy an AdonisJS API to Vercel


I'm having trouble deploying my AdonisJS (v6) application to Vercel. Despite following the AdonisJS documentation, I haven't been able to resolve the issue.

The deployment process on Vercel completes successfully, but when I try to access the app I get a 404 Not Found error. I'm not sure if there's an issue with routing or configuration, but I can't figure out what's wrong.

Here is my Vercel project configuration :

Vercel configuration

And here is my scripts in my package.json :

"scripts": {
    "start": "node bin/server.js",
    "build": "node ace build",
    "dev": "node ace serve --hmr",
    "test": "node ace test",
    "lint": "eslint .",
    "format": "prettier --write .",
    "typecheck": "tsc --noEmit"
  }`

I tried to search on forums, docs... but I could not find anything that helps!


Solution

  • You just cannot run server on Vercel, like using "npm run start" or "node build/server.js" for Adonis for example

    You can see it directly in Vercel's guide if you need more information: https://vercel.com/guides/npm-run-start-not-working