-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
61 lines (55 loc) · 1.14 KB
/
gulpfile.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
var gulp = require('gulp');
// 引入组件
var connect = require('gulp-connect');
var proxy = require('http-proxy-middleware');
var apis = [
'/customer',
'/Customer',
'/File',
'/file',
'/GameProject',
'/Identity',
'/Goods',
'/Leaguer',
'/Member',
'/Message',
'/numbergen',
'/Organization',
'/POS',
'/Price',
'/Product',
'/Terminal',
'/Ticket',
'/VirtualCurrency',
'/Workbranch',
'/Product',
'/Order',
];
var proxys = [];
for (var i = 0; i < apis.length; i++) {
var api = apis[i];
proxys.push(
proxy(api, {
target: 'http://192.168.100.138',
changeOrigin:true
}
));
}
gulp.task('webserver', function () {
connect.server({
livereload: true,
root: 'wwwroot',
middleware: function(connect, opt) {
return proxys;
}
});
});
gulp.task('js', function () {
gulp.src('./app/*.js')
.pipe(connect.reload());
});
gulp.task('watch', function () {
gulp.watch(['./wwwroot/*.js'], ['js']);
});
// gulp.task('default');
gulp.task('default', ['webserver', 'watch']);