diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..cd05187 --- /dev/null +++ b/.env.example @@ -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 diff --git a/.gitignore b/.gitignore index 40ddf43..09002e2 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ # Environment .env +.env.production # dependencies /node_modules diff --git a/src/App.js b/src/App.js index e414a10..30ffde2 100644 --- a/src/App.js +++ b/src/App.js @@ -70,8 +70,9 @@ const PrivateRoute = ({ children, adminOnly = false }) => { }; function App() { - // Use /membership basename only in production - const basename = process.env.NODE_ENV === 'production' ? '/membership' : ''; + // Read basename from environment variable (defaults to empty string for root path) + // Set REACT_APP_BASENAME in .env to use a subpath (e.g., "/membership") + const basename = process.env.REACT_APP_BASENAME || ''; return (