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

Add Ability to use base URL via PUBLIC_URL environment variable #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ To run the app, run:
yarn start
#+END_SRC

To run the app behind a base or custom URL, first build the app using the ~PUBLIC_URL~ variable, then start the app. For example, to use a url base of ~/org-web~:

#+BEGIN_SRC
PUBLIC_URL="/org-web" yarn build
serve -s build -l 3000
#+END_SRC

To test against your actual Dropbox, you'll need to create a ~.env~ file by copying ~.env.sample~ to just ~.env~. To test against your Google Drive you'll need to generate an API key as described on [[https://developers.google.com/drive/api/v3/quickstart/js][this page]].

Note that this will only work if you're running the app on ~http://localhost:3000~ because all redirect URIs must be specified ahead of time on the Dropbox and Google developer consoles.
Expand Down
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export default class App extends PureComponent {
render() {
return (
<DragDropContext onDragEnd={this.handleDragEnd}>
<Router>
<Router basename={`${process.env.PUBLIC_URL}`}>
<Provider store={this.store}>
<div className="App">
<Entry />
Expand Down