fix: Configure proper API URLs for production and development
- Add .env.production with production API URL (https://litter-api.psbailey.uk/api) - Create getApiBaseUrl() helper function for static assets - Update ReportDetailModal to use dynamic API URL - Fix default API port to 3005 across all services - Images will now load correctly in both dev and production
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
// API service configuration and base client
|
||||
import { useAuth } from '@clerk/clerk-react';
|
||||
|
||||
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || 'http://localhost:3000/api';
|
||||
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || 'http://localhost:3005/api';
|
||||
|
||||
// Export function to get the base URL without /api suffix for static assets
|
||||
export const getApiBaseUrl = () => {
|
||||
return (import.meta.env.VITE_API_BASE_URL || 'http://localhost:3005/api').replace('/api', '');
|
||||
};
|
||||
|
||||
export interface ApiError {
|
||||
code: string;
|
||||
|
||||
Reference in New Issue
Block a user