Use webpack dev proxy to serve api/media

This commit is contained in:
Eliot Berriot 2018-02-18 14:29:35 +01:00
commit 50af04345b
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
4 changed files with 17 additions and 9 deletions

View file

@ -28,7 +28,20 @@ module.exports = {
autoOpenBrowser: true,
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {},
proxyTable: {
'/api': {
target: 'http://nginx:6001',
changeOrigin: true,
},
'/media': {
target: 'http://nginx:6001',
changeOrigin: true,
},
'/staticfiles': {
target: 'http://nginx:6001',
changeOrigin: true,
}
},
// CSS Sourcemaps off by default because relative paths are "buggy"
// with this option, according to the CSS-Loader README
// (https://github.com/webpack/css-loader#sourcemaps)