DEV Community

Cover image for Create and deploy an Express NodeJS with UI using Vercel (Free)
Duc Ng
Duc Ng

Posted on

Create and deploy an Express NodeJS with UI using Vercel (Free)

Disclosure: I have no affiliation or investment in any company mentioned in this post. This is just my experience.

I assumed you have some experience with NodeJS, ExpressJS and signed up with Vercel.

Vercel (zeit) has been working fine for me for a while. The problem is there are different ways on the internet to set it up and most of them doesn't work for me anymore, maybe due to changes from Vercel. But I'm glad this setup works now.

In this article, I just want to share my experience and github repository which you can use it to create your own Express NodeJS App and deploy it to Vercel.

Github repository link:

Set up & Deploy with Vercel

$ npm install vercel -g
$ npm install
$ vercel
Enter fullscreen mode Exit fullscreen mode

app/index.js

  • If you're using Typescript, build your source directory, output to "app"
  • Update package.json: "main": "app/index.js"

vercel.json

  • Map API routes (/api/...) and static (UI) routes (/...).

Now you have a full-stack web application deployed to the Internet using Vercel! Happy coding!

Links:

Top comments (4)

Collapse
 
seanmclem profile image
Seanmclem

How bad is a cold-start on their free tier?

Collapse
 
ngduc profile image
Duc Ng

I think it uses serverless but I haven't noticed any long delay compared to other websites.

Collapse
 
seanmclem profile image
Seanmclem

Found a Blog on medium confirming it was at least a little faster than Firebase. Which basically has zero cold start problem compared to something like Heroku

Thread Thread
 
ngduc profile image
Duc Ng

Good to know! Vercel (zeit) has been working fine for me for a while. The problem is there are different ways on the internet to set it up and most of them doesn't work for me, maybe due to changes from vercel. But I'm glad this setup works now.