Deploy Node.js application to Vercel in 5 minutes

Search for a command to run...

No comments yet. Be the first to comment.
In this article, I would like to document how I deploy a Docker image to Google Cloud using Cloud Run. Build the docker image Refer to my article Dockerizing a Node.js web application for developing a Node.js application and building a docker image....
In this article, we'll write a JUnit Test configured with Environment Variables using junit-pioneer library. First of all, we need to add the junit-pioneer library and maven-surefire-plugin to the Maven pom.xml. <project> <properties> <p...
Problem The problem occurs when using the Python requests library, the chardet library is not installed. /Users/adacheng/Library/Python/3.9/lib/python/site-packages/requests/__init__.py:86: RequestsDependencyWarning: Unable to find acceptable charact...

Apache Kafka is an open-source distributed event streaming platform for high-performance data pipelines, streaming analytics, data integration, and mission-critical applications. Introduction This article aims to provide basic hands-on instructions ...

Problem When AWS STS module is included in a Spring Boot Application, exception complaining region not set is thrown. Maven pom.xml <dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>sts</artifactId> </dependency> Error M...

Installation Follow the instruction in this article to install Trivy. Scan To scan the docker image: Build the image. docker build . -t hello-world Scan the image. trivy scan hello-world

Deploying a Node.js application to Vercel can be easily done by just adding a vercel.json configuration file to your project root directory.
Here I will show you how it can be achieved.
First of all, add a vercel.json file in the root directory of your existing Node.js project. Add and commit the file to the Git repository.
{
"version": 2,
"name": "music-album",
"builds": [
{ "src": "app.js", "use": "@vercel/node" }
],
"routes": [
{ "src": "/(.*)", "dest": "/app.js" }
]
}
Login Vercel.
If you don't have an account yet, you can sign up for a free account.
Click the "+ New Project" button on the Overview tab.

Import Git Repository by selecting the Git provider. GitHub, GitLab and Bitbucket are available.

Import Git Repository.

Configure the project.
Click the "Deploy" button. The deployment should be triggered.

Check the deployment status.

Click the link under DOMAINS to view the application in browser.

Congratulations! Your Node.js application is now configured to be deployed to Vercel easily by adding a configuration file to the project.