Compare commits

...

2 Commits

Author SHA1 Message Date
e82e584f76 changed static paths to relative api paths so useable without cors 2025-10-23 14:45:15 +02:00
e177c3d2a6 changed frontend path 2025-10-23 14:19:29 +02:00
5 changed files with 5 additions and 5 deletions

View File

@@ -40,7 +40,7 @@ app.get('/api/health', (req: any, res: any) => {
});
// 🆕 STATIC FILE SERVING FÜR FRONTEND
const frontendBuildPath = path.join(__dirname, '../../frontend-build');
const frontendBuildPath = path.join(__dirname, '../frontend-build');
console.log('📁 Frontend build path:', frontendBuildPath);
// Überprüfe ob das Verzeichnis existiert

View File

@@ -20,7 +20,7 @@ interface AuthContextType {
}
const AuthContext = createContext<AuthContextType | undefined>(undefined);
const API_BASE_URL = process.env.REACT_APP_API_BASE_URL || 'http://localhost:3002/api';
const API_BASE_URL = process.env.REACT_APP_API_BASE_URL || '/api';
interface AuthProviderProps {
children: ReactNode;

View File

@@ -1,6 +1,6 @@
// frontend/src/services/authService.ts
import { Employee } from '../models/Employee';
const API_BASE = process.env.REACT_APP_API_BASE_URL || 'http://localhost:3002/api';
const API_BASE = process.env.REACT_APP_API_BASE_URL || '/api';
export interface LoginRequest {
email: string;

View File

@@ -1,7 +1,7 @@
// frontend/src/services/employeeService.ts
import { Employee, CreateEmployeeRequest, UpdateEmployeeRequest, EmployeeAvailability } from '../models/Employee';
const API_BASE_URL = 'http://localhost:3002/api';
const API_BASE_URL = '/api';
const getAuthHeaders = () => {
const token = localStorage.getItem('token');

View File

@@ -4,7 +4,7 @@ import { Employee, EmployeeAvailability } from '../models/Employee';
import { authService } from './authService';
import { AssignmentResult, ScheduleRequest } from '../models/scheduling';
const API_BASE_URL = 'http://localhost:3002/api';
const API_BASE_URL = '/api';