diff --git a/server/routes.js b/server/routes.js index b873465..ec26edf 100644 --- a/server/routes.js +++ b/server/routes.js @@ -32,7 +32,7 @@ const upload = multer({ storage }); const router = new Router(); router.get('/', (req, res) => { res.render('index', { - bundle: url.resolve(entryPoint, webpackConfig.output.filename), + bundle: url.resolve(entryPoint, `/dev-server${webpackConfig.output.filename}`), title: 'PiZilla' }); }); diff --git a/webpack.config.babel.js b/webpack.config.babel.js index d5b0186..c39dd71 100644 --- a/webpack.config.babel.js +++ b/webpack.config.babel.js @@ -4,7 +4,10 @@ import webpack from 'webpack'; const config = { devServer: { hot: true, - inline: true + inline: true, + proxy: { + '/': 'http://localhost:8000/' + } }, devtool: 'cheap-module-eval-source-map', entry: path.resolve(__dirname, 'app', 'main.js'), @@ -55,7 +58,8 @@ const config = { }, output: { filename: 'bundle.js', - path: path.resolve(__dirname, 'build', 'client') + path: path.resolve(__dirname, 'build', 'client'), + publicPath: '/dev-server' }, plugins: [ new webpack.optimize.OccurrenceOrderPlugin(),