Max Chu | 3c8b65f | 2017-07-19 17:47:59 -0700 | [diff] [blame^] | 1 | const conf = require('./gulp.conf'); |
2 | const proxy = require('./proxy'); | ||||
3 | |||||
4 | module.exports = function () { | ||||
5 | return { | ||||
6 | server: { | ||||
7 | baseDir: [ | ||||
8 | conf.paths.tmp, | ||||
9 | conf.paths.src | ||||
10 | ], | ||||
11 | middleware: function (req, res, next) { | ||||
12 | if (req.url.indexOf('xosapi') !== -1 || req.url.indexOf('xos') !== -1 || req.url.indexOf('socket') !== -1) { | ||||
13 | proxy.api.web(req, res); | ||||
14 | } | ||||
15 | else { | ||||
16 | next(); | ||||
17 | } | ||||
18 | } | ||||
19 | }, | ||||
20 | open: false | ||||
21 | }; | ||||
22 | }; |