Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 1 | const conf = require('./gulp.conf'); |
Matteo Scandolo | c80ccbd | 2017-02-27 16:24:33 -0800 | [diff] [blame] | 2 | const proxy = require('./proxy'); |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 3 | |
| 4 | module.exports = function () { |
| 5 | return { |
| 6 | server: { |
| 7 | baseDir: [ |
| 8 | conf.paths.tmp, |
| 9 | conf.paths.src |
Matteo Scandolo | 1aee198 | 2017-02-17 08:33:23 -0800 | [diff] [blame] | 10 | ], |
| 11 | middleware: function(req, res, next){ |
| 12 | if (req.url.indexOf('xosapi') !== -1) { |
| 13 | proxy.web(req, res); |
| 14 | } |
| 15 | else{ |
| 16 | next(); |
| 17 | } |
| 18 | } |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 19 | }, |
Matteo Scandolo | 1aee198 | 2017-02-17 08:33:23 -0800 | [diff] [blame] | 20 | open: true |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 21 | }; |
| 22 | }; |