Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Router basename fix #607

Merged
merged 2 commits into from
May 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .example.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
REACT_APP_MAPBOX_TOKEN=REDACTED
DB_URL=REDACTED
BASE_URL=/311-data
2 changes: 0 additions & 2 deletions .github/workflows/Continuous_Delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
run: |
echo REACT_APP_MAPBOX_TOKEN=${{ secrets.MAPBOX_TOKEN }} > .env
echo DB_URL=${{ secrets.DB_URL }} >> .env
echo BASE_URL=${{ secrets.BASE_URL }} >> .env
echo GITHUB_SHA=${{ github.sha }} >> .env
- name: Build project
run: npm run build
Expand All @@ -36,7 +35,6 @@ jobs:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
REACT_APP_MAPBOX_TOKEN: ${{ secrets.MAPBOX_TOKEN }}
DB_URL: ${{ secrets.DB_URL }}
BASE_URL: ${{ secrets.BASE_URL }}
BASE_BRANCH: master # The branch the action should deploy from.
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: dist # The folder the action should deploy.
Expand Down
1 change: 0 additions & 1 deletion Orchestration/docker-compose-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ services:
environment:
REACT_APP_MAPBOX_TOKEN: REDACTED
DB_URL: http://localhost:5000
BASE_URL: ''
ports:
- 3000:3000

Expand Down
1 change: 0 additions & 1 deletion copyEnv.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
echo REACT_APP_MAPBOX_TOKEN=$REACT_APP_MAPBOX_TOKEN > .env
echo DB_URL=$DB_URL >> .env
echo BASE_URL=$BASE_URL >> .env
webpack
node server.js
4 changes: 1 addition & 3 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import Footer from './components/main/footer/Footer';
import StaticFooter from './components/main/footer/StaticFooter';
import { SnapshotRenderer } from './components/export/SnapshotService';

const basename = process.env.NODE_ENV === 'development' ? '/' : process.env.BASE_URL || '/';

const App = ({
getMetadata,
}) => {
Expand All @@ -21,7 +19,7 @@ const App = ({
});

return (
<Router basename={basename}>
<Router>
<Header />
<Routes />
<Switch>
Expand Down