2016-10-21 12 views

答えて

1

、ただのconfig/webpack.dev.jsにdevServerのプロキシを設定へ必要があります。

module.exports = { 
    entry:{...}, 
    ... 
    devServer: { 
     host: 'localhost', 
     port: 8086, //frontend port 
     historyApiFallback: true, 
     noInfo: true, 
     watchOptions: { 
      aggregateTimeout: 300, 
      poll: 100 
     }, 
     outputPath: '/', 
     proxy: { 
      '/api/*': { //backend url prefix, some thing like '/api/users/:userId' 
       target: 'http://localhost:3000', // backend host and port 
       secure: false 
      } 
     } 
    } 
}; 
関連する問題