33 lines
No EOL
896 B
JavaScript
33 lines
No EOL
896 B
JavaScript
module.exports = {
|
|
webpack: {
|
|
configure: (webpackConfig) => {
|
|
// Fix for webpack dev server allowedHosts issue
|
|
if (webpackConfig.devServer) {
|
|
webpackConfig.devServer.allowedHosts = 'all';
|
|
}
|
|
return webpackConfig;
|
|
},
|
|
},
|
|
devServer: {
|
|
allowedHosts: 'all',
|
|
host: 'localhost',
|
|
port: 3000,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:5000',
|
|
changeOrigin: true,
|
|
secure: false,
|
|
logLevel: 'debug',
|
|
onProxyReq: (proxyReq, req, res) => {
|
|
// Ensure proper content-type headers
|
|
if (req.body) {
|
|
const bodyData = JSON.stringify(req.body);
|
|
proxyReq.setHeader('Content-Type', 'application/json');
|
|
proxyReq.setHeader('Content-Length', Buffer.byteLength(bodyData));
|
|
proxyReq.write(bodyData);
|
|
}
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|