Added .env configuration to remove hardcoded IP issues
This commit is contained in:
5
frontend/.env.example
Normal file
5
frontend/.env.example
Normal file
@@ -0,0 +1,5 @@
|
||||
# Frontend Configuration
|
||||
# API_BASE should include the /api path
|
||||
REACT_APP_API_BASE=http://localhost:3001/api
|
||||
# API_HOST is used for direct file URLs (no /api)
|
||||
REACT_APP_API_HOST=http://localhost:3001
|
||||
@@ -1,7 +1,8 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Search, FileText, AlertCircle, Download, Upload, Eye, Filter, CheckCircle, XCircle, Loader, Trash2, Plus } from 'lucide-react';
|
||||
|
||||
const API_BASE = 'http://192.168.2.117:3001/api';
|
||||
const API_BASE = process.env.REACT_APP_API_BASE || 'http://localhost:3001/api';
|
||||
const API_HOST = process.env.REACT_APP_API_HOST || 'http://localhost:3001';
|
||||
|
||||
const severityLevels = ['All Severities', 'Critical', 'High', 'Medium', 'Low'];
|
||||
|
||||
@@ -625,8 +626,8 @@ export default function App() {
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
<a
|
||||
href={`http://192.168.2.117:3001/${doc.file_path}`}
|
||||
<a
|
||||
href={`${API_HOST}/${doc.file_path}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="px-3 py-1 text-sm text-[#0476D9] hover:bg-blue-50 rounded transition-colors border border-[#0476D9]"
|
||||
|
||||
Reference in New Issue
Block a user