🖨 Print / Save PDF
← Lesson
BitWith
Bite
Full-Stack · Quick Reference
Lesson 31 — Deploy to Railway
Cheat Sheet
Full-Stack
In one line:
Railway hosts your always-on Express server; MongoDB Atlas hosts the database — connect them with env vars and don't forget CORS.
6 Steps
1
Create a free Atlas cluster
2
Whitelist network access (0.0.0.0/0)
3
Push repo to GitHub
4
Import repo on railway.app
5
Set MONGO_URI + JWT_SECRET
CORS Fix
const cors = require('cors'); app.use(cors({ origin: 'https://your-app.vercel.app' }));
6
Point frontend's API URL at the Railway URL