-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
27 lines (25 loc) · 701 Bytes
/
server.js
File metadata and controls
27 lines (25 loc) · 701 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
/**
* Created by qitmac000068 on 2017/7/5.
*/
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('./webpack.config');
new WebpackDevServer(webpack(config),{
publicPath:config.output.publicPath,
hot:true,
historyApiFallback:true,
stats:{colors:true},
headers:{
'Access-Control-Allow-Origin':'*'
},
proxy:{//跨域可以用http-proxy-middleware
'/test/*':{
target:'http://127.0.0.1',
changeOrigin:true,
secure:false
}
}
}).listen(3000,'127.0.0.1',function(err,result){
if(err) console.log(err);
console.log('Listening at 127.0.0.1:3000');
});