Skip to main content

Command Palette

Search for a command to run...

Deploy Express.js Server to Vercel

Updated
โ€ข2 min read
Deploy Express.js Server to Vercel
J

I am a tech lover and frontend developer specializing in creating scalable, user-friendly, and modern websites/web.

My goal is to help users have a smooth and seamless experience on the web.

Over the past few days, I've been trying to figure out how to deploy my express.js server to vercel to host and connect to my little project that uses AI [chatGPT] ๐Ÿ‘‰๐Ÿปhttps://transx.jahkamso.com, but I wasn't successful, until now.

Today, I'll guide you through the steps on how I was able to successfully deploy your server to vercel.

  1. Open up your project [server folder], create a new file called vercel.json, and add this to your file ๐Ÿ‘‡๐Ÿป

The above is simply what helps vercel know that you're deploying a node project and also to handle all your routes in your index.js file.

  1. Head over to your package.json file and add the following before your "scripts" ๐Ÿ‘‡๐Ÿป

You need to add this to our file because vercel currently uses "nodejs 18.x". It doesn't support the latest version of nodejs [version 20.11.1] at the moment.

  1. Import your code to vercel and deploy your project ๐Ÿ‘‡๐Ÿป

Open vercel, click the "Add New" button, and then click on "Project"

Import your code from Github ๐Ÿ‘‡๐Ÿป

Then click "Deploy" and you're good to go ๐Ÿ’ช๐Ÿป

These are the steps I used to solve the issue with deploying my express.js server to vercel. Hope you found this useful :)

You can check out the project I worked on and let me know what you think by leaving a comment ๐Ÿ‘‰๐Ÿป https://transx.jahkamso.com