🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)
🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)

🔧 Programmierung 🕛 kürzlich 2 Min Lesezeit
0

Deploying a MERN Project to Vercel: Frontend and Backend Separately

↗ Quelle (dev.to)
🗣️ Stimme:

Today, I will give step-by-step instructions on how to deploy a MERN project to Vercel, with the frontend and backend deployed separately.



1. Create Project Directory:




CODE
   mkdir mernproject
cd mernproject






2. Initialize Node Project:




CODE
  npm init -y






3.Install Express:




CODE
npm install express







4. Install Other Necessary Packages for Backend:




CODE
npm install cors body-parser dotenv mongoose






5. Create .env File:




CODE
touch .env








  • Add your tokens and other sensitive information in this file.



6. install Nodemon:




CODE
npm install --save-dev nodemon








  • This will automatically restart your project when you save.



7.Create Server File:




CODE
touch server.js







8.Set Up React:




CODE
npx create-react-app client








  • Replace client with the name of the folder you want your frontend to be in. In this case, I use client.



9. Build Frontend:




  • when you are done coding and it's time to deploy:




CODE
cd client
npm build
git add .
git commit -m "Build frontend"
git push origin main






10. Deploy Frontend to Vercel:




  • If you have already initialized Vercel with GitHub, you will see your project in Vercel.


  • Import your project in Vercel.




11.Copy Frontend Link:




  • Copy the link generated by Vercel.



12 Update Backend:




CODE
app.use(
cors({
origin: 'frontend link',
})
);






13.Deploy Backend to Vercel:




  • At the root of your project, create a vercel.json file and add the following code inside:




CODE
{
"version": 2,
"builds": [{ "src": "server.js", "use": "@vercel/node" }],
"routes": [{ "src": "/(.*)", "dest": "server.js" }]
}







  • This will tell Vercel the entry point of your project. If the entry point is not server.js, replace server.js with the entry point of your server.


  • Create a .gitignore file:





CODE
touch .gitignore







  • Add node_modules, .env, and frontend-folder to .gitignore.


  • Ensure your frontend folder is in .gitignore because you don't need to deploy that again.




14. Push to GitHub and Upload to Vercel:




  • Push your folder to GitHub and upload to Vercel.



15. Set Environment Variables in Vercel:




  • Go to your project directory in Vercel, click on settings, click on environment variables, import your .env file, and save.


  • Make sure you're in your imported backend directory after successfully uploading before uploading the variables.




After these steps, your project will work perfectly as it does in development mode.

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
3 Quellen
GPT-6 Astra Release Today? OpenAI’s Next Major AI Model Is Almost Here
1 Quelle
Apple accuses OpenAI of destroying evidence as trade-secrets fight intensifies
1 Quelle
Major AI platforms go down in unprecedented simultaneous outage
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Deploying a MERN Project to Vercel: Frontend and Backend Separately

Thematisch verwandte Begriffe: Deploying, MERN, Project, Vercel · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...