-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
26 lines (21 loc) · 755 Bytes
/
server.js
File metadata and controls
26 lines (21 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('./webpack.config');
config.entry.app.unshift("webpack-dev-server/client?http://localhost:9090", "webpack/hot/dev-server");
config.devtool = 'eval';
var proxy = {
"/api/*": {target: "https://python-china.org", host: "python-china.org"},
"/session*": {target: "https://python-china.org", host: "python-china.org"},
};
var app = new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
historyApiFallback: true,
proxy: proxy,
hot: true,
});
app.listen(9090, 'localhost', function (err, result) {
console.log('Listening http://localhost:9090');
if (err) {
console.log(err);
}
});