![]() |
Vercel is a popular cloud platform that is known for its excellent support in building and deploying scalable Frontend infrastructure. In this article, we will look into how to deploy an Express.js web Application to Vercel. We will use the Serverless computing feature of Vercel to deploy our express.js application. Prerequisites
Approach to deploy Express App to vercel
Deploying Express Application to VercelStep 1: Create a folder for the project and deployment mkdir deploy_expressjs_vercel Step 2: Initialized the express application and install express npm init -y Project Structure ![]() Project structure The updated dependencies in package.json file will look like : "dependencies": { Step 3: Create a folder structure similar to instructed and add the following files in respective directories.
Note:
app.use(express.static("public"))
Step 4: Install Vercel CLI & Login npm install --global vercel Step 5: Deploy Express App to Vercel by running the following command. vercel ![]() Incase you need to redeploy after making changes use the vercel command with prod flag. vercel --prod Output: Now run the deployed link on the browser. |
Reffered: https://www.geeksforgeeks.org
Express.js |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 13 |