This guide will help you deploy your plain Express.js app on Vercel step by step.
π Repository: Recursion Hub
Create a vercel.json
file in the root of your project and add the following configuration:
{
"version": 2,
"rewrites": [{ "source": "/(.*)", "destination": "/server.js" }],
"builds": [{ "src": "server.js", "use": "@vercel/node" }]
}
rewrites
: Redirects all incoming requests toserver.js
.builds
: Specifies thatserver.js
should be handled using Vercelβs Node.js runtime.
Run the following commands in your project root:
# Install Vercel CLI globally
npm install -g vercel
# Start local development server
vercel dev
# Deploy to Vercel
vercel
Once the deployment is complete, Vercel will provide a live URL for your app. π
After linking GitHub, your app will automatically redeploy whenever you push changes to the repository.
If you want to disable auto-deploy for all branches other than main, follow these steps:
Your Express.js app is now live on Vercel! π If you have any issues, check out the [Vercel Docs](https://vercel.com/docs) or let me know. Happy coding! π―