Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
update hash router
Browse files- frontend/src/App.js +1 -1
- frontend/src/config/api.js +7 -4
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 |
-
|
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
|
4 |
-
//
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
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;
|