fix: centralize API URL configuration in constants

- Move API base URL to single constant in @/constants/api
- Update all API modules to import from centralized location
- Ensure consistent port 8080 usage across frontend
- Support VITE_API_URL environment variable for flexible deployment
This commit is contained in:
Chris Scott committed 2025-11-24 00:17:05 -05:00
1 parent e4e255b2bc
commit 1555a6d641
7 files changed
+19 -9

No files matched your search

@@ -8,8 +8,9 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog'
import { FolderOpen, Upload, RefreshCw, X } from 'lucide-react'
import type { FileInfo } from '@/types/files'
import { API_BASE_URL } from '@/constants/api'
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:5001'
const API_BASE = API_BASE_URL
// Hook to detect mobile screens
const useIsMobile = () => {
@@ -2,8 +2,9 @@ import { useState } from 'react'
import { Button } from '@/components/ui/button'
import { Download, Copy, X, Edit3, Save, X as XIcon } from 'lucide-react'
import type { FileInfo } from '@/types/files'
import { API_BASE_URL } from '@/constants/api'
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:5001'
const API_BASE = API_BASE_URL
interface FilePreviewProps {
file: FileInfo