blob: 06cb51a7afd18c784c8fc2b15488ace7c58f9397 [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) {
Matteo Scandolo0d4d1a22017-07-13 11:45:37 -070012 if (req.url.indexOf('xosapi') !== -1 || req.url.indexOf('xos') !== -1 || req.url.indexOf('socket') !== -1) {
Matteo Scandoloe19fa102017-03-09 15:38:59 -080013 proxy.api.web(req, res);
14 }
Matteo Scandoloe19fa102017-03-09 15:38:59 -080015 else {
16 next();
17 }
18 }
19 },
20 open: false
21 };
22};