docs: function(connect, options) {
              var base = "./";//(typeof options.base == "string") ? options.base : options.base[0];
              if (!Array.isArray(options.base)) {
                  options.base = [options.base];
              }
              var base = path.resolve(options.base[0]);
              //return [serveStatic(base),serveIndex(base)];
              return [
                  // connect.compress({
                  //     level: 9
                  // }),
                  //require('connect-livereload')(),
                  function(req, res, next) {
                      if (req.headers.origin === undefined) {
                          res.setHeader('Access-Control-Allow-Origin', "*");
                      } else {
                          res.setHeader('Access-Control-Allow-Origin', req.headers.origin);
                      }
                      res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
                      console.log(req.method + " on " + req.originalUrl);
                      if (req.method === "OPTIONS") {
                          res.setHeader('Access-Control-Allow-Headers', 'content-type');
                          res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
                          res.setHeader('Content-Length', '0');
                          res.setHeader('Content-Type', 'application/json; charset=utf-8');
                          grunt.file.read(req.originalUrl.split("?")[0]);
                          //res.write(body);
                          res.end("200");
                          //next();
                      } else {
                          next();
                      }
                  },
                  serveStatic(base),
                  function(req, res, next) {
                      if (showIndex(req.originalUrl)) {
                          var body = grunt.file.read("index.html");
                          res.write(body);
                          res.end();
                      } else {
                          res.setHeader('Access-Control-Allow-Headers', 'content-type');
                          res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
                          //res.setHeader('Content-Length', '0');
                          res.setHeader('Content-Type', 'application/json; charset=utf-8');
                          datahandler(req, res, STUBS_URL, function() {
                              console.log("first end");
                              res.end();
                              //next();
                          });
                      }
                  },
                  function(req, res, next) {
                      if (req.headers.origin === undefined) {
                          res.setHeader('Access-Control-Allow-Origin', "*");
                      } else {
                          res.setHeader('Access-Control-Allow-Origin', req.headers.origin);
                      }
                      if (showIndex(req.originalUrl)) {
                          var body = grunt.file.read("index.html");
                          res.write(body);
                          console.log("2nd end");
                          res.end();
                      } else {
                          next();
                      }
                  },
                  serveIndex(base)
              ];
          }