npm run dev
# veya
nodemon server.js✨ Özellikler:
- ✅ Dosya değişikliklerinde otomatik restart
- ✅ server.js, HTML, CSS, JS değişikliklerini izler
- ✅ Development için ideal
- ⚡ Hızlı geliştirme döngüsü
npm start
# veya
node server.js📊 Özellikler:
- Production ortamı için
- Manuel restart gerekli
- Daha hafif resource kullanımı
npm install -g pm2npm run pm2:startnpm run pm2:status # Durumu kontrol et
npm run pm2:logs # Logları görüntüle
npm run pm2:restart # Restart
npm run pm2:stop # Durdur
npm run pm2:delete # PM2'den kaldır🚀 PM2 Avantajları:
- ✅ Otomatik restart on crash
- ✅ Load balancing (multiple instances)
- ✅ Log management
- ✅ Process monitoring
- ✅ Startup script (boot time)
pm2 startup
pm2 savenpm run stopnpm run restartnpm run quick
# veya
./start.shcd ~/flight-planner
npm installnpm run devserver.js- Backend değişiklikleripublic/app.js- Frontend JavaScriptpublic/style.css- Stylingpublic/index.html- HTML structure
Nodemon otomatik olarak restart yapar! ✨
- Browser: http://localhost:3000
- Console: F12 (debug logs)
- Server logs: Terminal'de görünür
Nodemon şu dosyaları izler:
- ✅
server.js - ✅
public/**/*.js - ✅
public/**/*.html - ✅
public/**/*.css
Ignore edilen:
- ❌
node_modules/ - ❌
data/ - ❌
backup/ - ❌
.git/
# Port 3000'i kontrol et
lsof -ti:3000
# Port'u temizle
npm run stop
# Tekrar başlat
npm run dev# Global install
npm install -g nodemon
# veya npx kullan
npx nodemon server.js# Nodemon config kontrol
cat nodemon.json
# Manuel restart (nodemon içinde)
rsDefault port: 3000
Değiştirmek için:
// server.js
const PORT = 3000; // Bu satırı değiştirveya environment variable:
PORT=8080 npm run devTerminal'de görünür (stdout)
pm2 logs flight-dispatch
pm2 logs flight-dispatch --lines 100
pm2 logs flight-dispatch --err # Sadece errorsLog dosyaları:
logs/out.log- Standard outputlogs/err.log- Errorslogs/combined.log- Combined
- ✅
npm run devkullan - ✅ Browser DevTools aç
- ✅ React DevTools (eğer kullanılıyorsa)
- ✅
pm2kullan - ✅ Load balancing için multiple instances
- ✅ Memory limit: 1GB (ecosystem.config.js)
- ✅ Automatic restart on crash
| Command | Description |
|---|---|
npm run dev |
⚡ Development (auto-restart) |
npm start |
📦 Production (manual) |
npm run restart |
🔄 Kill + Restart dev |
npm run stop |
⛔ Stop server |
npm run quick |
🚀 Smart start |
npm run pm2:start |
🔥 PM2 production |
npm run pm2:logs |
📋 View PM2 logs |
✅ Nodemon installed and configured
✅ Auto-restart enabled
✅ PM2 config ready
✅ Smart startup script created
Server is running with auto-restart! 🎉
Access: http://localhost:3000
Last updated: $(date)