text: "use strict";
  exports.__esModule = true;
  exports.logger = void 0;
  require("https://raw.githubusercontent.com/daychongyang/dotenv/master/load.ts");
  var mod_ts_1 = require("https://deno.land/x/oak/mod.ts");
  var statistics_ts_1 = require("./statistics.ts");
  var logger_ts_1 = require("https://deno.land/x/logger@v1.0.2/logger.ts");
  var loader_ts_1 = require("./loader.ts");
  exports.logger = new logger_ts_1["default"]();
  var app = new mod_ts_1.Application();
  var router = new mod_ts_1.Router();
  var testData = await loader_ts_1.loadData();
  var stats = new statistics_ts_1.StatisticsService(app);
  var PORT = Number.parseInt(Deno.env.get("DEV_PORT") || "80", 10);
  router.get('/api/random', function (context) {
      var index = Math.floor(Math.random() * testData.length);
      context.response.body = testData[index];
  });
  stats.initialize(app);
  stats.route(router);
  app.use(router.routes());
  app.use(router.allowedMethods());
  await app.listen({ port: PORT });
  