Dev-server proxies /api and WS request to backend.

This commit is contained in:
2020-12-06 23:19:15 +01:00
parent 9265572e45
commit 1839810e66
7 changed files with 131 additions and 149 deletions

View File

@@ -11,7 +11,6 @@ try {
message: "INSERT MESSAGE",
date: 5,
hours: 15,
apiUrl: "http://localhost:30030",
gatewayToken: "asd"
};
}

View File

@@ -5,7 +5,6 @@ module.exports = {
message: "VINLOTTERI",
date: 5,
hours: 15,
apiUrl: undefined,
gatewayToken: undefined,
vinmonopoletToken: undefined,
googleanalytics_trackingId: undefined,

View File

@@ -81,7 +81,6 @@ const webpackConfig = function(isDev) {
__MESSAGE__: JSON.stringify(env.message),
__DATE__: env.date,
__HOURS__: env.hours,
__APIURL__: JSON.stringify(env.apiUrl),
__PUSHENABLED__: JSON.stringify(require("./defaults/push") != false),
__GA_TRACKINGID__: JSON.stringify(env.googleanalytics_trackingId),
__GA_COOKIELIFETIME__: env.googleanalytics_cookieLifetime

View File

@@ -33,11 +33,24 @@ let webpackConfig = merge(commonConfig(true), {
devServer: {
compress: true,
historyApiFallback: true,
host: "0.0.0.0",
hot: true,
overlay: true,
stats: {
normal: true
}
},
proxy: {
"/api": {
target: "http://localhost:30030",
changeOrigin: true
},
"/socket.io": {
target: "ws://localhost:30030",
changeOrigin: false,
ws: true
}
},
writeToDisk: false
}
});