"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));

var _hookHandler = _interopRequireDefault(require("./hookHandler"));

var _errorHandler = _interopRequireDefault(require("./errorHandler"));

var globHandler = /*#__PURE__*/function () {
  var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(app, config) {
    var path, errorHook;
    return _regenerator["default"].wrap(function _callee$(_context) {
      while (1) {
        switch (_context.prev = _context.next) {
          case 0:
            path = require("path");
            _context.next = 3;
            return app.register(require("fastify-static"), {
              root: path.join(__dirname, "./Assets"),
              prefix: '/dkaframork/assets/',
              decorateReply: false
            });

          case 3:
            _context.next = 5;
            return (0, _errorHandler["default"])(app, config);

          case 5:
            errorHook = _context.sent;
            _context.next = 8;
            return (0, _hookHandler["default"])(errorHook, config);

          case 8:
            return _context.abrupt("return", _context.sent);

          case 9:
          case "end":
            return _context.stop();
        }
      }
    }, _callee);
  }));

  return function globHandler(_x, _x2) {
    return _ref.apply(this, arguments);
  };
}();

var _default = globHandler;
exports["default"] = _default;
//# sourceMappingURL=GlobHandler.js.map