-
Notifications
You must be signed in to change notification settings - Fork 91
/
server.js
37 lines (36 loc) · 1.06 KB
/
server.js
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
27
28
29
30
31
32
33
34
35
36
37
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const config = require('./webpack.config');
config.entry.app.unshift("webpack-dev-server/client?http://localhost:3000/", "webpack/hot/only-dev-server");
new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
historyApiFallback: true,
hot: true,
inline:true,
noInfo: false,
stats: {
colors: true,
},
proxy: {
'/kugou': {
target: 'http://m.kugou.com/',
changeOrigin:true,
pathRewrite: {"^/kugou" : ""}
},
"/yy_kugou": {
target: "http://www.kugou.com/yy/",
changeOrigin: true,
pathRewrite: {"^/yy_kugou" : ""}
},
"/mobilecdn": {
target: "http://mobilecdn.kugou.com",
changeOrigin: true,
pathRewrite: {"^/mobilecdn" : ""}
}
}
}).listen(3000, 'localhost', function(err) {
if (err) {
console.log(err);
}
console.log('Listening at localhost:3000');
});