blob: 33b0ab5b3830174270a13227952d2527aa819c8a [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: {
Matteo Scandolo37d56062017-04-24 15:03:00 -070023 "/xos": "./dist"
Matteo Scandolo4e870232017-01-30 13:43:05 -080024 }
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};