Skip to content

Commit

Permalink
add http-proxy config for local Docker server
Browse files Browse the repository at this point in the history
  • Loading branch information
jgaehring committed Jul 11, 2018
1 parent ff97879 commit 562d55d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
3 changes: 2 additions & 1 deletion build/webpack.dev.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ const devWebpackConfig = merge(baseWebpackConfig, {
? { warnings: false, errors: true }
: false,
publicPath: config.dev.assetsPublicPath,
proxy: config.dev.proxyTable,
proxy: config.dev.proxy,
headers: config.dev.headers,
quiet: true, // necessary for FriendlyErrorsPlugin
watchOptions: {
poll: config.dev.poll,
Expand Down
20 changes: 19 additions & 1 deletion config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,25 @@ module.exports = {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {},
proxy: [{
logLevel: 'debug',
context: [
'/user/',
'/login/',
'/restws/',
'/log',
],
target: 'http://localhost:80',
changeOrigin: true,
secure: false
}],
// Add headers to all http requests (for CORS)
headers: {
// 'Access-Control-Allow-Origin': '*',
// "Access-Control-Allow-Credentials": "true",
// "Access-Control-Allow-Headers": "Content-Type, Authorization, x-id, Content-Length, X-Requested-With",
// "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS"
},

// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
Expand Down

0 comments on commit 562d55d

Please sign in to comment.