blob: 430c94f501d166d177303bc53bf7f8951c997900 [file] [log] [blame]
Matteo Scandoloe19fa102017-03-09 15:38:59 -08001const conf = require('./gulp.conf');
2const proxy = require('./proxy');
3
4module.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) {
13 proxy.api.web(req, res);
14 }
15 else if (req.url.indexOf('spa') !== -1 || req.url.indexOf('socket') !== -1) {
16 proxy.static.web(req, res);
17 }
18 else {
19 next();
20 }
21 }
22 },
23 open: false
24 };
25};