Deploy Express.js Server to Vercel

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.
- 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.
- 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.
- 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
