text: var auth = require('../helpers/auth');
  var proxy = require('../helpers/proxy');
  
  var config = {
    /**
     * --------- ADD YOUR UAA CONFIGURATION HERE ---------
     *
     * This uaa helper object simulates NGINX uaa integration using Grunt allowing secure cloudfoundry service integration in local development without deploying your application to cloudfoundry.
     * Please update the following uaa configuration for your solution
     */
    uaa: {
      clientId: 'infyOAuth',
      serverUrl: 'https://e328b0d1-222e-43bf-b795-c5d0f687b3b8.predix-uaa.run.aws-usw02-pr.ice.predix.io',
      defaultClientRoute: '/about',
      base64ClientCredential: 'aW5meU9BdXRoOnBhc3N3b3Jk'
    },
    /**
     * --------- ADD YOUR SECURE ROUTES HERE ------------
     *
     * Please update the following object add your secure routes
     *
     * Note: Keep the /api in front of your services here to tell the proxy to add authorization headers.
     */
    proxy: {
      '/api/view-service(.*)': {
        url: 'http://predix-views-dev.grc-apps.svc.ice.ge.com/v1$1',
        instanceId: '49a92fd6-df7b-45f6-925e-0bca94be7313'
      }
    }
  };
  
  module.exports = {
    server: {
      options: {
        port: 9000,
        base: 'public',
        open: true,
        hostname: 'localhost',
        middleware: function (connect, options) {
          var middlewares = [];
  
          //add predix services proxy middlewares
          middlewares = middlewares.concat(proxy.init(config.proxy));
  
          //add predix uaa authentication middlewaress
          middlewares = middlewares.concat(auth.init(config.uaa));
  
          if (!Array.isArray(options.base)) {
            options.base = [options.base];
          }
  
          var directory = options.directory || options.base[options.base.length - 1];
          options.base.forEach(function (base) {
            // Serve static files.
            middlewares.push(connect.static(base));
          });
  
          // Make directory browse-able.
          middlewares.push(connect.directory(directory));
  
          return middlewares;
        }
      }
    }
  };
  