Skip to content

Instantly share code, notes, and snippets.

@anotherjesse
Created February 23, 2017 22:48
Show Gist options
  • Select an option

  • Save anotherjesse/c6e0050aeab0aa4301ea3285736f5355 to your computer and use it in GitHub Desktop.

Select an option

Save anotherjesse/c6e0050aeab0aa4301ea3285736f5355 to your computer and use it in GitHub Desktop.
webpack-plus-flask
commit 45f8b56d252df8b9f7b6209068e1eddd2f6fee2b
Author: jesse andrews <anotherjesse@gmail.com>
Date: Fri Feb 10 10:57:28 2017 -0800
add proxy to 5000
diff --git a/package.json b/package.json
index 492dd54..39797a7 100644
--- a/package.json
+++ b/package.json
@@ -41,6 +41,7 @@
"eslint-plugin-react": "^5.0.1",
"extract-text-webpack-plugin": "^1.0.1",
"html-webpack-plugin": "^2.16.1",
+ "http-proxy-middleware": "^0.17.3",
"json-loader": "^0.5.4",
"node-sass": "^3.7.0",
"postcss-loader": "^0.9.1",
diff --git a/server.js b/server.js
index f210454..5369c2f 100644
--- a/server.js
+++ b/server.js
@@ -11,6 +11,12 @@ new WebpackDevServer(webpack(config), {
// It suppress everything except error, so it has to be set to false as well
// to see success build.
noInfo: false,
+ proxy: {
+ '/flask/route/': {
+ target: 'http://localhost:5000',
+ secure: false
+ }
+ },
stats: {
// Config for minimal console.log mess.
assets: false,
@@ -27,4 +33,4 @@ new WebpackDevServer(webpack(config), {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment