Compare commits

...

1 Commits

Author SHA1 Message Date
15107cdc63 removed routing 2025-10-22 23:31:38 +02:00
2 changed files with 12 additions and 19 deletions

View File

@@ -1,6 +1,7 @@
// backend/src/server.ts
import express from 'express';
import cors from 'cors';
import { fileURLToPath } from 'url';
import path from 'path';
import { initializeDatabase } from './scripts/initializeDatabase.js';
// Route imports
@@ -11,13 +12,18 @@ import setupRoutes from './routes/setup.js';
import scheduledShifts from './routes/scheduledShifts.js';
import schedulingRoutes from './routes/scheduling.js';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const app = express();
const PORT = 3002;
// CORS und Middleware
app.use(cors());
// Middleware
app.use(express.json());
// Serviere statische Frontend-Dateien
app.use(express.static(path.join(__dirname, '../../frontend-build')));
// API Routes
app.use('/api/setup', setupRoutes);
app.use('/api/auth', authRoutes);

View File

@@ -2,7 +2,7 @@
module.exports = {
apps: [
{
name: 'backend',
name: 'schichtplaner',
script: './dist/server.js',
instances: 1,
exec_mode: 'fork',
@@ -10,21 +10,8 @@ module.exports = {
NODE_ENV: 'production',
PORT: 3002
},
error_file: './logs/backend-err.log',
out_file: './logs/backend-out.log',
time: true
},
{
name: 'frontend',
script: 'npx',
args: 'serve -s frontend-build -l 3000',
instances: 1,
exec_mode: 'fork',
env: {
NODE_ENV: 'production'
},
error_file: './logs/frontend-err.log',
out_file: './logs/frontend-out.log',
error_file: './logs/app-err.log',
out_file: './logs/app-out.log',
time: true
}
]