DEV Community

Cover image for Deploy a node server to Vercel!
Dev Sharma
Dev Sharma

Posted on β€’ Originally published at blog.devsharma.live

1 2

Deploy a node server to Vercel!

Vercel 😏

Vercel, the creator of Next js. But isn't that where you are supposed to host your frontend applications.
Yes, but not just that!
We can host a node backend applications on Vercel. Vercel essentially allows running a server on Vercel.

Deploying to Vercel

Create a free account on Vercel. (Preferably, use a provider where the repository for code is hosted)

Add a vercel.json file in the root folder.

{
  "version": 2,
  "name": "name-of-your-vercel-app",
  "builds": [
    { "src": "script.js", "use": "@vercel/node" }
  ],
  "routes": [
    { "src": "/(.*)", "dest": "/index.js" }
  ]
}

Enter fullscreen mode Exit fullscreen mode

Now create a new projecton Vercel.

image.png
When setting up the repository, we need to select the Other option in Frameworks to deploy a backend server. You can also configure Environment variables at this stage.

image.png
And that's it you have deployed your server blazing fast πŸš€.

If you are a developer enjoying Vercel to deploy your front-end applications, you will definitely love Vercel for hosting your backend node applications.

What's your go-to way for deploying a node server? πŸ™ŒπŸ»

Source repo: mongo-CRUD-basics
Deployed app: https://mongoose-crud.vercel.app/
Feel free to reach out to me on Twitter and connect with me on LinkedIn

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

Top comments (1)

Collapse
 
ikeeptrying profile image
Dre β€’

What did you use for front end? How does that work with Vercel?

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay