Deploy Express.js app to Vercel

After research how to deploy Express.js app to Vercel. Finally, I found and got have an application has deployed to Vercel. It’s take a lot of time from me but I am happy and hope this article will help something to you.

I. First of all, crea…


This content originally appeared on DEV Community and was authored by Ha Tuan Em

After research how to deploy Express.js app to Vercel. Finally, I found and got have an application has deployed to Vercel. It's take a lot of time from me but I am happy and hope this article will help something to you.

I. First of all, creating new Github repository and init new project nodejs.

Clone and init project

II. Creating new project in Vercel

image

III. Installing package express to nodejs app.

install express package

IV. Creating and endpoint file index.js in root source.

Creating index.js file

V. Creating APIs in ./api folder or you can rename anything which you like.

  • Here is an example for manage product from ./api/product.

API folder

VI. Testing before commit source to Github.

Testing

  • After testing is ?. Commit them to git to see something awesome.

VII. Ready to serve in Vercel.

image

VIII. Something went wrong in Vercel.

image

  • Because Vercel just supports API from Framework JS as NEXT.JS, Nuxt.JS,... So if we develop a standalone application we need to configure or tell the server of Vercel how is it work by vercel.json file.

IX. Add new vercel.json file to root source.

  • Commit it to GitHub and make sure version is 2 - this is required from Vercel.

Vercel.json file

X. Done, enjoy your moment.

Thanks for reading.
And I hope something good to you.
Here is repository which use in this post.


This content originally appeared on DEV Community and was authored by Ha Tuan Em


Print Share Comment Cite Upload Translate Updates
APA

Ha Tuan Em | Sciencx (2021-07-04T14:57:05+00:00) Deploy Express.js app to Vercel. Retrieved from https://www.scien.cx/2021/07/04/deploy-express-js-app-to-vercel/

MLA
" » Deploy Express.js app to Vercel." Ha Tuan Em | Sciencx - Sunday July 4, 2021, https://www.scien.cx/2021/07/04/deploy-express-js-app-to-vercel/
HARVARD
Ha Tuan Em | Sciencx Sunday July 4, 2021 » Deploy Express.js app to Vercel., viewed ,<https://www.scien.cx/2021/07/04/deploy-express-js-app-to-vercel/>
VANCOUVER
Ha Tuan Em | Sciencx - » Deploy Express.js app to Vercel. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/07/04/deploy-express-js-app-to-vercel/
CHICAGO
" » Deploy Express.js app to Vercel." Ha Tuan Em | Sciencx - Accessed . https://www.scien.cx/2021/07/04/deploy-express-js-app-to-vercel/
IEEE
" » Deploy Express.js app to Vercel." Ha Tuan Em | Sciencx [Online]. Available: https://www.scien.cx/2021/07/04/deploy-express-js-app-to-vercel/. [Accessed: ]
rf:citation
» Deploy Express.js app to Vercel | Ha Tuan Em | Sciencx | https://www.scien.cx/2021/07/04/deploy-express-js-app-to-vercel/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.