code: function index(config) {
      return (req, res) => {
          const schema = opt.createSchema(),
                data = utils.validate(req.data, schema);
  
          if (data.error) {
              res.json(error(data.error.details));
          } else {
              const options = opt.readOptions(data.value, schema),
                    siteUrl = options.url;
  
              if (!isUrlAllowed(config, siteUrl)) {
                  sendError(res, util.format('URL "%s" is not allowed', siteUrl));
              } else {
                  const callbackUrl = options.callback;
                  if (callbackUrl) {
                      res.json(message(util.format(
                          'Data file will be sent to "%s" when processed', callbackUrl
                          )));
  
                      logger.debug('Streaming (\"%s\") to \"%s\"', siteUrl, callbackUrl);
  
                      capture.screenshot(options, config, sendImageToUrl(res, config, options));
                  } else {
                      logger.debug('Sending file (\"%s\") in response', siteUrl);
                      capture.screenshot(options, config, sendImageInResponse(res, config, options));
                  }
              }
  
          }
      };
  }
docs: /* Controller