blob: dd768bb084a691607be66bf4c891d6223237b58e [file] [log] [blame]
Matteo Scandolod819c922016-12-02 14:06:14 -08001const conf = require('./gulp.conf');
Matteo Scandolof4d80132017-03-20 11:49:17 -07002const proxy = require('./proxy').proxy;
3const extensionsProxy = require('./proxy').extensionsProxy;
Matteo Scandolod819c922016-12-02 14:06:14 -08004
5module.exports = function () {
6 return {
7 server: {
8 baseDir: [
9 conf.paths.dist
Matteo Scandolo4e870232017-01-30 13:43:05 -080010 ],
Matteo Scandoloc80ccbd2017-02-27 16:24:33 -080011 middleware: function(req, res, next){
12 if (req.url.indexOf('xosapi') !== -1) {
13 proxy.web(req, res);
14 }
Matteo Scandolof4d80132017-03-20 11:49:17 -070015 else if (req.url.indexOf('extensions') !== -1) {
16 extensionsProxy.web(req, res);
17 }
Matteo Scandoloc80ccbd2017-02-27 16:24:33 -080018 else{
19 next();
20 }
21 },
Matteo Scandolo4e870232017-01-30 13:43:05 -080022 routes: {
23 "/spa": "./dist"
24 }
Matteo Scandolod819c922016-12-02 14:06:14 -080025 },
Matteo Scandoloc80ccbd2017-02-27 16:24:33 -080026 open: true
Matteo Scandolod819c922016-12-02 14:06:14 -080027 };
28};