DEV Community

Mahlil Mahee
Mahlil Mahee

Posted on

Deploy Node App in Vercel

After the finishing of the era of Heruku free tiar , I had to find out a hosting platform for deploying my server codes or backend codes. I have tried cyclic, render, railway and vercel .
Among them Railway do not allow us to host our app live more than 21 days in the free plan .

And Render allow us this feature but it goes sleep in every 15 minutes of inactivity of the api we have called.

For that I loved using the free version of Cyclic and Vercel.

Today I am going to discuss about how to deploy node app in the vercel and Next day I will be showing the same method for Cyclic.

Check out the process donot miss any of them otherwise it will make you Mad like me :

1 . We need to export our node file so that others can access the files or codes from the file .
just write the code at the end point of your node js file
module.exports = app;

Image description

  1. Then the most important things to do is adding a vercel.json file in the root of your project . And write down the following code their in the file

Image description

and the file structure should be like this

Image description

  1. Now make a github repository and push all the codes there . And go to vercel and log in with github it will make easiar for you to find all the repository you added and finding the needed one .

  2. Now go to dashboard and click on add new select project and then select the github repository which contain all of your project files .

Image description

  1. Then it will show you the project configuration page . You donot need to add anything there . But If you have env variable then their is a section for you where you can add them

Image description
Image description

  1. And then deploy . And it will take you to the project page .There you will get a domain section and click on them it will take you to the live site of your project .

That is all for today .Deploy you site and share with your clients .

Top comments (0)