1
0
Fork 0

feat(Dev proxy) : Add proxy to localhost:8080 in dev mode.

This commit is contained in:
Maxime Wojtczak 2017-05-04 00:22:48 +02:00 committed by Fernandez Ludovic
parent b24b5e20b4
commit 61ba50fac9
3 changed files with 38 additions and 2 deletions

View file

@ -1,4 +1,15 @@
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 {
@ -6,6 +17,10 @@ module.exports = function () {
baseDir: [
conf.paths.tmp,
conf.paths.src
],
middleware: [
apiProxy,
healthProxy
]
},
open: false