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
- Vercel will generate ".vercel" directory, don't share or commit this one.
- After deploying, open your URL like this:
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:
- 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
Top comments (4)
How bad is a cold-start on their free tier?
I think it uses serverless but I haven't noticed any long delay compared to other websites.
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
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.