2016-07-23 17:59:54 +00:00
|
|
|
const conf = require('./gulp.conf');
|
2017-05-03 22:22:48 +00:00
|
|
|
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
|
|
|
|
});
|
2016-07-23 17:59:54 +00:00
|
|
|
|
|
|
|
module.exports = function () {
|
|
|
|
return {
|
|
|
|
server: {
|
|
|
|
baseDir: [
|
|
|
|
conf.paths.tmp,
|
|
|
|
conf.paths.src
|
2017-05-03 22:22:48 +00:00
|
|
|
],
|
|
|
|
middleware: [
|
|
|
|
apiProxy,
|
|
|
|
healthProxy
|
2016-07-23 17:59:54 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
open: false
|
|
|
|
};
|
|
|
|
};
|