Fix runtime error
This commit is contained in:
17
.env.example
Normal file
17
.env.example
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Server Configuration
|
||||||
|
PORT=3000
|
||||||
|
WDS_SOCKET_PORT=443
|
||||||
|
|
||||||
|
# Backend API URL
|
||||||
|
REACT_APP_BACKEND_URL=http://localhost:8000
|
||||||
|
|
||||||
|
# App Base Path Configuration
|
||||||
|
# Examples:
|
||||||
|
# - For root path: REACT_APP_BASENAME=
|
||||||
|
# - For subpath: REACT_APP_BASENAME=/membership
|
||||||
|
# - For production: REACT_APP_BASENAME=/membership
|
||||||
|
REACT_APP_BASENAME=
|
||||||
|
|
||||||
|
# Feature Flags
|
||||||
|
REACT_APP_ENABLE_VISUAL_EDITS=false
|
||||||
|
ENABLE_HEALTH_CHECK=false
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
# Environment
|
# Environment
|
||||||
.env
|
.env
|
||||||
|
.env.production
|
||||||
|
|
||||||
# dependencies
|
# dependencies
|
||||||
/node_modules
|
/node_modules
|
||||||
|
|||||||
@@ -70,8 +70,9 @@ const PrivateRoute = ({ children, adminOnly = false }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
// Use /membership basename only in production
|
// Read basename from environment variable (defaults to empty string for root path)
|
||||||
const basename = process.env.NODE_ENV === 'production' ? '/membership' : '';
|
// Set REACT_APP_BASENAME in .env to use a subpath (e.g., "/membership")
|
||||||
|
const basename = process.env.REACT_APP_BASENAME || '';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AuthProvider>
|
<AuthProvider>
|
||||||
|
|||||||
Reference in New Issue
Block a user