Files
meldestelle/client/webpack.config.d/dev-server.js
T
2025-09-17 15:03:54 +02:00

48 lines
1.3 KiB
JavaScript

// Development server configuration with API proxy
// This forwards API requests from webpack-dev-server to the gateway
if (config.mode !== 'production') {
config.devServer = {
...config.devServer,
// Proxy API requests to the gateway - using modern object syntax
proxy: {
'/api/**': {
target: 'http://localhost:8081',
changeOrigin: true,
secure: false,
logLevel: 'debug',
pathRewrite: {
'^/api': '/api' // Keep the /api prefix for gateway routing
}
}
},
// Disable all caches as requested in previous issue
headers: {
'Cache-Control': 'no-cache, no-store, must-revalidate',
'Pragma': 'no-cache',
'Expires': '0'
},
// Development middleware settings
devMiddleware: {
writeToDisk: false,
stats: 'minimal'
},
// Static files configuration
static: {
directory: 'src/commonMain/resources',
serveIndex: true,
watch: true
},
// CORS settings for development
allowedHosts: 'all',
historyApiFallback: true,
hot: true,
liveReload: true
};
}