Create and Deploy a Node.js/Express App with UI for Free with Vercel
How to deploy your own Express Node.js App from GitHub to Vercel
Disclosure: I have no affiliation or investment in any company mentioned in this post. This is just my experience.
I assume you have some experience with Node.js, Express and have signed up for a free Vercel account.
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.
Github repository link:
First, clone the above repository to a local directory. Set up vercel command line and run “vercel” command to deploy the project:
Set up & Deploy with Vercel
$ npm install vercel -g$ cd <project-dir>
$ npm install
- Vercel will generate a “.vercel” directory, don’t share or commit this one.
- After deploying, open your URL that looks like this:
— Example: https://vercel-express-3.ngduc.vercel.app
- If you’re using Typescript with node, build your source directory (using a tool like “tsc” command line from “typescript” package), output to “app”.
- Update package.json: “main”: “app/index.js”
- Map API routes (/api/…) and static (UI) routes (/…).
Now you have a full-stack web application deployed to the Internet using Vercel!
- This official article describes more in details about Vercel and Express — https://vercel.com/guides/using-express-with-vercel
- Github Repo — https://github.com/ngduc/vercel-express