#how to config nestjs on vercel

17 messages · Page 1 of 1 (latest)

untold thicket
#

how to deploy on vercel, my config

{
  "version": 2,
  "builds": [
    {
      "src": "src/main.ts",
      "use": "@vercel/node"
    }
  ],
  "routes": [
    {
      "src": "/(.*)",
      "dest": "src/main.ts",
      "methods": ["GET", "POST", "PATCH", "DELETE"]
    }
  ]
}

but my code is on src -> res -> users
what should config do?

summer lintel
#

So, vercel's node server support is for severless environments.. Are you running NestJS as a severless approach?

summer lintel
#

Use a proper server solution, in my opinion. EC2, digital ocean, gcp, hetzner, heck a raspberry pi if you're not doing anything too crazy

untold thicket
#

so vercel can't host right?

summer lintel
#

Okay? My statement stands. You want to host an API server? Use an actual server environment

untold thicket
#

could you recommand for alternative heroku?

summer lintel
#

Vercel claims that it can do regular servers, but the example express app is incredibly basic and they don't go into detail (at least quickly) want using ts for the build

summer lintel
# untold thicket could you recommand for alternative heroku?

EC2, GCP, Digital Ocean, Hetzner, I've heard of people using Railway, and there are others out there.

I've personally got a side project on my raspberrypi and will probably migrate to hetzner when I need more power, but I don't really anticipate that ever happening

untold thicket
summer lintel
#

I have not, but it looks straightforward

signal thunder
#

I have used render - it's as straightforward as it gets (like heroku)

untold thicket
summer lintel
untold thicket