-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- install packages for flask url building and the babel macro - provide url map to flask-urls macro - setup proxying from the CRA server to the flask dev server
- Loading branch information
1 parent
1717f75
commit 7d36dac
Showing
5 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const {execSync} = require('child_process'); | ||
|
||
const urlMap = JSON.parse(execSync('flask url_map_to_json')); | ||
|
||
module.exports = { | ||
flaskURLs: { | ||
urlMap, | ||
}, | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const proxy = require('http-proxy-middleware'); | ||
|
||
// we need a custom proxy config since for some reason the "proxy" option in package.json | ||
// forwards even the websocket requests that are meant for the auto reloader... | ||
// https://github.com/facebook/create-react-app/issues/7323 | ||
module.exports = app => { | ||
app.use(proxy('/api', {target: process.env.FLASK_URL || 'http://127.0.0.1:5000'})); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
zip_safe=False, | ||
install_requires=[ | ||
'Flask', | ||
'flask_url_map_serializer', | ||
'python-dotenv' | ||
], | ||
) |