Is it possible to deploy a NodeJs app in Vercel?

Run yarn global add now@latest to install the CLI

  1. Create a now.json file and paste this
{
  "version": 2,
  "builds": [{
    "src": "./server.js",
    "use": "@now/node-server"
  }],
  "routes": [{"handle": "filesystem"},
    {
      "src": "/.*",
      "dest": "server.js"
    }
  ]
}

Note: Change "src": "server.js", && "dest":"server.js" to your server entry file.

  1. Add it to .gitignore

  2. Then run now in the CLI to deploy.

If you are deploying to production use now --prod command in the CLI to deploy

Here is an example server that I deployed: https://vercel-example-server.now.sh.

Leave a Comment

techhipbettruvabetnorabahisbahis forumueduedusedusedueduedusedueduedusedu