Port numaraları değişti.
This commit is contained in:
@@ -53,8 +53,8 @@ npm install
|
||||
npm run dev
|
||||
|
||||
# 4. Tarayıcıda açma
|
||||
# Frontend: http://localhost:5173
|
||||
# Backend API: http://localhost:3000
|
||||
# Frontend: http://localhost:5005
|
||||
# Backend API: http://localhost:3005
|
||||
```
|
||||
|
||||
#### 1.2 Development Workflow
|
||||
@@ -1531,7 +1531,7 @@ const getFuelSlips = (userId, status) => {
|
||||
const corsOptions = {
|
||||
origin: process.env.NODE_ENV === 'production'
|
||||
? 'https://your-domain.com'
|
||||
: ['http://localhost:5173', 'http://localhost:4173'],
|
||||
: ['http://localhost:5005', 'http://localhost:4005'],
|
||||
methods: ['GET', 'POST', 'PUT', 'DELETE'],
|
||||
allowedHeaders: ['Content-Type', 'Authorization'],
|
||||
credentials: true,
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
KNOWLEDGE_BASE.md'deki iş akışlarına göre implement edilen tam fonksiyonel yakıt takip sistemi.
|
||||
|
||||
### 🚀 **Sunucu Durumu**
|
||||
- **Frontend**: `http://localhost:5173/` (SvelteKit)
|
||||
- **Backend**: `http://localhost:3000` (Express/Socket.IO)
|
||||
- **Frontend**: `http://localhost:5005/` (SvelteKit)
|
||||
- **Backend**: `http://localhost:3005` (Express/Socket.IO)
|
||||
- **Status**: ✅ Çalışıyor
|
||||
|
||||
## 🔐 **Test Kullanıcıları**
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
"main": "src/server.js",
|
||||
"scripts": {
|
||||
"dev": "npm run server & npm run client",
|
||||
"server": "node src/server.js",
|
||||
"client": "vite dev",
|
||||
"server": "PORT=3005 node src/server.js",
|
||||
"client": "vite dev --port 5005",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"start": "node src/production-server.js",
|
||||
"preview": "vite preview --port 5005",
|
||||
"start": "PORT=3005 node src/production-server.js",
|
||||
"prod": "npm run build && npm run start",
|
||||
"setup": "node -e \"import('./src/server.js').then(() => console.log('Database setup completed')).catch(console.error);\"",
|
||||
"init-db": "node -e \"import('./src/server.js').catch(console.error)\""
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
console.log('🔌 Connecting to Socket.IO...');
|
||||
// Socket.IO bağlantısı
|
||||
socket = io('http://localhost:3001');
|
||||
socket = io('http://localhost:3005');
|
||||
|
||||
console.log('👤 Goods Manager ID:', user.id);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ let socket = null;
|
||||
|
||||
export function getSocketClient() {
|
||||
if (!socket) {
|
||||
socket = io('http://localhost:3001', {
|
||||
socket = io('http://localhost:3005', {
|
||||
transports: ['websocket', 'polling']
|
||||
});
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ const app = express();
|
||||
const server = createServer(app);
|
||||
const io = new Server(server, {
|
||||
cors: {
|
||||
origin: process.env.NODE_ENV === 'production' ? false : ["http://localhost:5173"],
|
||||
origin: process.env.NODE_ENV === 'production' ? false : ["http://localhost:5005"],
|
||||
methods: ["GET", "POST"]
|
||||
}
|
||||
});
|
||||
@@ -80,7 +80,7 @@ const io = new Server(server, {
|
||||
// Export io for use in other modules
|
||||
export { io };
|
||||
|
||||
const PORT = process.env.PORT || 3001;
|
||||
const PORT = process.env.PORT || 3005;
|
||||
|
||||
// ES Module equivalent of __dirname
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
|
||||
@@ -117,7 +117,7 @@ const app = express();
|
||||
const server = createServer(app);
|
||||
const io = new Server(server, {
|
||||
cors: {
|
||||
origin: "http://localhost:5173",
|
||||
origin: "http://localhost:5005",
|
||||
methods: ["GET", "POST"]
|
||||
}
|
||||
});
|
||||
@@ -125,7 +125,7 @@ const io = new Server(server, {
|
||||
// Export io for use in other modules
|
||||
export { io };
|
||||
|
||||
const PORT = process.env.PORT || 3001;
|
||||
const PORT = process.env.PORT || 3005;
|
||||
|
||||
// ES Module equivalent of __dirname
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
|
||||
@@ -4,10 +4,10 @@ import { defineConfig } from 'vite';
|
||||
export default defineConfig({
|
||||
plugins: [sveltekit()],
|
||||
server: {
|
||||
port: 5173,
|
||||
port: 5005,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:3001',
|
||||
target: 'http://localhost:3005',
|
||||
changeOrigin: true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user