tfrere commited on
Commit
31d11b5
·
1 Parent(s): 2c8e1bd

update hash router

Browse files
frontend/src/App.js CHANGED
@@ -1,7 +1,7 @@
1
  import React from "react";
2
  import { Box, Container, CssBaseline } from "@mui/material";
3
  import {
4
- BrowserRouter as Router,
5
  Routes,
6
  Route,
7
  Navigate,
 
1
  import React from "react";
2
  import { Box, Container, CssBaseline } from "@mui/material";
3
  import {
4
+ HashRouter as Router,
5
  Routes,
6
  Route,
7
  Navigate,
frontend/src/config/api.js CHANGED
@@ -1,9 +1,12 @@
1
  // API Configuration
2
  const API_CONFIG = {
3
- // Use the current origin in production and development
4
- // This ensures requests are always routed through the Express server
5
- // which will proxy them to the backend
6
- BASE_URL: window.location.origin,
 
 
 
7
  };
8
 
9
  export default API_CONFIG;
 
1
  // API Configuration
2
  const API_CONFIG = {
3
+ // Use the current origin in production
4
+ // In development, use localhost:3001 explicitly
5
+ BASE_URL:
6
+ process.env.NODE_ENV === "development" ||
7
+ window.location.hostname === "localhost"
8
+ ? "http://localhost:3001"
9
+ : window.location.origin,
10
  };
11
 
12
  export default API_CONFIG;