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.dist | ||||
Matteo Scandolo | 4e87023 | 2017-01-30 13:43:05 -0800 | [diff] [blame] | 9 | ], |
Matteo Scandolo | c80ccbd | 2017-02-27 16:24:33 -0800 | [diff] [blame] | 10 | middleware: function(req, res, next){ |
11 | if (req.url.indexOf('xosapi') !== -1) { | ||||
12 | proxy.web(req, res); | ||||
13 | } | ||||
14 | else{ | ||||
15 | next(); | ||||
16 | } | ||||
17 | }, | ||||
Matteo Scandolo | 4e87023 | 2017-01-30 13:43:05 -0800 | [diff] [blame] | 18 | routes: { |
19 | "/spa": "./dist" | ||||
20 | } | ||||
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 21 | }, |
Matteo Scandolo | c80ccbd | 2017-02-27 16:24:33 -0800 | [diff] [blame] | 22 | open: true |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 23 | }; |
24 | }; |