feat(Dev proxy) : Add proxy to localhost:8080 in dev mode.
This commit is contained in:
parent
b24b5e20b4
commit
61ba50fac9
3 changed files with 38 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue