mirror of
https://github.com/donpat1to/Schichtenplaner.git
synced 2025-11-30 22:45:46 +01:00
removed routing
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
// backend/src/server.ts
|
// backend/src/server.ts
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
import cors from 'cors';
|
import { fileURLToPath } from 'url';
|
||||||
|
import path from 'path';
|
||||||
import { initializeDatabase } from './scripts/initializeDatabase.js';
|
import { initializeDatabase } from './scripts/initializeDatabase.js';
|
||||||
|
|
||||||
// Route imports
|
// Route imports
|
||||||
@@ -11,13 +12,18 @@ import setupRoutes from './routes/setup.js';
|
|||||||
import scheduledShifts from './routes/scheduledShifts.js';
|
import scheduledShifts from './routes/scheduledShifts.js';
|
||||||
import schedulingRoutes from './routes/scheduling.js';
|
import schedulingRoutes from './routes/scheduling.js';
|
||||||
|
|
||||||
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
|
const __dirname = path.dirname(__filename);
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const PORT = 3002;
|
const PORT = 3002;
|
||||||
|
|
||||||
// CORS und Middleware
|
// Middleware
|
||||||
app.use(cors());
|
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
|
|
||||||
|
// Serviere statische Frontend-Dateien
|
||||||
|
app.use(express.static(path.join(__dirname, '../../frontend-build')));
|
||||||
|
|
||||||
// API Routes
|
// API Routes
|
||||||
app.use('/api/setup', setupRoutes);
|
app.use('/api/setup', setupRoutes);
|
||||||
app.use('/api/auth', authRoutes);
|
app.use('/api/auth', authRoutes);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
apps: [
|
apps: [
|
||||||
{
|
{
|
||||||
name: 'backend',
|
name: 'schichtplaner',
|
||||||
script: './dist/server.js',
|
script: './dist/server.js',
|
||||||
instances: 1,
|
instances: 1,
|
||||||
exec_mode: 'fork',
|
exec_mode: 'fork',
|
||||||
@@ -10,21 +10,8 @@ module.exports = {
|
|||||||
NODE_ENV: 'production',
|
NODE_ENV: 'production',
|
||||||
PORT: 3002
|
PORT: 3002
|
||||||
},
|
},
|
||||||
error_file: './logs/backend-err.log',
|
error_file: './logs/app-err.log',
|
||||||
out_file: './logs/backend-out.log',
|
out_file: './logs/app-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',
|
|
||||||
time: true
|
time: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user