'use strict';

Object.defineProperty(exports, "__esModule", {
	value: true
});

var _regenerator = require('babel-runtime/regenerator');

var _regenerator2 = _interopRequireDefault(_regenerator);

var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator');

var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);

var _renderPage = require('../../library/render-page');

var _renderPage2 = _interopRequireDefault(_renderPage);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function indexRouteFactory(application) {
	return function () {
		var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee() {
			return _regenerator2.default.wrap(function _callee$(_context) {
				while (1) {
					switch (_context.prev = _context.next) {
						case 0:
							_context.next = 2;
							return (0, _renderPage2.default)(application, this.request.url);

						case 2:
							this.body = _context.sent;

						case 3:
						case 'end':
							return _context.stop();
					}
				}
			}, _callee, this);
		}));

		function indexRoute() {
			return _ref.apply(this, arguments);
		}

		return indexRoute;
	}();
}

exports.default = indexRouteFactory;
module.exports = exports['default'];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9yb3V0ZXMvaW5kZXguanMiXSwibmFtZXMiOlsiaW5kZXhSb3V0ZUZhY3RvcnkiLCJhcHBsaWNhdGlvbiIsInJlcXVlc3QiLCJ1cmwiLCJib2R5IiwiaW5kZXhSb3V0ZSJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7QUFBQTs7Ozs7O0FBRUEsU0FBU0EsaUJBQVQsQ0FBMkJDLFdBQTNCLEVBQXdDO0FBQ3ZDO0FBQUEsd0VBQU87QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUEsY0FDWSwwQkFBV0EsV0FBWCxFQUF3QixLQUFLQyxPQUFMLENBQWFDLEdBQXJDLENBRFo7O0FBQUE7QUFDTixZQUFLQyxJQURDOztBQUFBO0FBQUE7QUFBQTtBQUFBO0F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