fix: resolve frontend API routing issues for Traefik deployment
Test and Lint / backend-test (push) Successful in 1m16s
continuous-integration/drone/push Build is failing
Test and Lint / frontend-test (push) Successful in 2m18s
Version and Release / version-bump (push) Successful in 43s
Version and Release / trigger-drone (push) Successful in 4s
Test and Lint / backend-test (push) Successful in 1m16s
continuous-integration/drone/push Build is failing
Test and Lint / frontend-test (push) Successful in 2m18s
Version and Release / version-bump (push) Successful in 43s
Version and Release / trigger-drone (push) Successful in 4s
Major fixes for production deployment with Traefik: 1. API Path Fixes: - Remove double /api prefix from all frontend service calls - Fix auth.service.ts to use correct paths (/auth/admin/login) - Update all services to use single /api prefix from base URL - Fix template literal paths in photo services 2. Docker Configuration: - Add build args for VITE_API_URL in docker-compose.prod.yml - Create Dockerfile.prod with proper API URL configuration - Ensure frontend is built with correct API base path 3. Documentation: - Add comprehensive TRAEFIK_DEPLOYMENT.md guide - Document proper Traefik labels and routing configuration - Include troubleshooting steps for common issues - Explain network configuration and SSL handling This resolves: - 502 Bad Gateway errors - Double /api/api paths in requests - Frontend unable to communicate with backend - Login functionality not working The frontend now correctly calls the backend API through Traefik's routing, with all requests going to /api/* being forwarded to the backend service on port 3000. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -79,19 +79,19 @@ export interface SystemStatus {
|
||||
export const settingsService = {
|
||||
// Get all settings
|
||||
async getAllSettings(): Promise<Record<string, any>> {
|
||||
const response = await api.get<Record<string, any>>('/api/admin/settings');
|
||||
const response = await api.get<Record<string, any>>('/admin/settings');
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// Get settings by type
|
||||
async getSettingsByType(type: 'branding' | 'theme' | 'general'): Promise<Record<string, any>> {
|
||||
const response = await api.get<Record<string, any>>(`/api/admin/settings/${type}`);
|
||||
const response = await api.get<Record<string, any>>(`/admin/settings/${type}`);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// Update branding settings
|
||||
async updateBranding(settings: BrandingSettings): Promise<void> {
|
||||
await api.put('/api/admin/settings/branding', settings);
|
||||
await api.put('/admin/settings/branding', settings);
|
||||
},
|
||||
|
||||
// Upload logo
|
||||
@@ -150,23 +150,23 @@ export const settingsService = {
|
||||
|
||||
// Update theme settings
|
||||
async updateTheme(settings: ThemeSettings): Promise<void> {
|
||||
await api.put('/api/admin/settings/theme', settings);
|
||||
await api.put('/admin/settings/theme', settings);
|
||||
},
|
||||
|
||||
// Update multiple settings at once
|
||||
async updateSettings(settings: Record<string, any>): Promise<void> {
|
||||
await api.put('/api/admin/settings/general', settings);
|
||||
await api.put('/admin/settings/general', settings);
|
||||
},
|
||||
|
||||
// Get storage information
|
||||
async getStorageInfo(): Promise<StorageInfo> {
|
||||
const response = await api.get<StorageInfo>('/api/admin/settings/storage/info');
|
||||
const response = await api.get<StorageInfo>('/admin/settings/storage/info');
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// Get system status
|
||||
async getSystemStatus(): Promise<SystemStatus> {
|
||||
const response = await api.get<SystemStatus>('/api/admin/system/status');
|
||||
const response = await api.get<SystemStatus>('/admin/system/status');
|
||||
return response.data;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user