Skip to content

Commit

Permalink
feat(Dev proxy) : Add proxy to localhost:8080 in dev mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime Wojtczak authored and ldez committed May 12, 2017
1 parent b24b5e2 commit 61ba50f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
15 changes: 15 additions & 0 deletions webui/conf/browsersync.conf.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
const conf = require('./gulp.conf');
const proxy = require('http-proxy-middleware');

const apiProxy = proxy('/api', {
target: 'http://localhost:8080',
changeOrigin: true
});

const healthProxy = proxy('/health', {
target: 'http://localhost:8080',
changeOrigin: true
});

module.exports = function () {
return {
server: {
baseDir: [
conf.paths.tmp,
conf.paths.src
],
middleware: [
apiProxy,
healthProxy
]
},
open: false
Expand Down
1 change: 1 addition & 0 deletions webui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"gulp-util": "^3.0.7",
"html-loader": "^0.4.3",
"html-webpack-plugin": "^2.9.0",
"http-proxy-middleware": "^0.17.4",
"isparta-loader": "^2.0.0",
"jasmine": "^2.4.1",
"json-loader": "^0.5.4",
Expand Down
24 changes: 22 additions & 2 deletions webui/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@ camelcase@^1.0.2, camelcase@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39"

camelcase@^2.0.0:
camelcase@^2.0.0, camelcase@^2.0.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f"

Expand Down Expand Up @@ -3034,13 +3034,29 @@ http-errors@~1.5.0:
setprototypeof "1.0.1"
statuses ">= 1.3.0 < 2"

http-proxy-middleware@^0.17.4:
version "0.17.4"
resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-0.17.4.tgz#642e8848851d66f09d4f124912846dbaeb41b833"
dependencies:
http-proxy "^1.16.2"
is-glob "^3.1.0"
lodash "^4.17.2"
micromatch "^2.3.11"

[email protected], http-proxy@^1.13.0:
version "1.15.1"
resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.15.1.tgz#91a6088172e79bc0e821d5eb04ce702f32446393"
dependencies:
eventemitter3 "1.x.x"
requires-port "1.x.x"

http-proxy@^1.16.2:
version "1.16.2"
resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.16.2.tgz#06dff292952bf64dbe8471fa9df73066d4f37742"
dependencies:
eventemitter3 "1.x.x"
requires-port "1.x.x"

http-signature@~0.11.0:
version "0.11.0"
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-0.11.0.tgz#1796cf67a001ad5cd6849dca0991485f09089fe6"
Expand Down Expand Up @@ -3905,6 +3921,10 @@ lodash@^4.0.0, lodash@^4.0.1, lodash@^4.14.0, lodash@^4.16.4, lodash@^4.2.0, lod
version "4.17.1"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.1.tgz#e75eaf17a34730c6491d9956f4d81f3a044f01bf"

lodash@^4.17.2:
version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"

lodash@~4.16.4:
version "4.16.6"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.16.6.tgz#d22c9ac660288f3843e16ba7d2b5d06cca27d777"
Expand Down Expand Up @@ -4021,7 +4041,7 @@ merge@^1.1.3:
version "1.2.0"
resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da"

[email protected], micromatch@^2.1.5, micromatch@^2.3.7:
[email protected], micromatch@^2.1.5, micromatch@^2.3.11, micromatch@^2.3.7:
version "2.3.11"
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565"
dependencies:
Expand Down

0 comments on commit 61ba50f

Please sign in to comment.