self::$Config->GetByDotKey("Database.Host"), "Port" => self::$Config->GetByDotKey("Database.Port"), "Username" => self::$Config->GetByDotKey("Database.Username"), "Password" => self::$Config->GetByDotKey("Database.Password"), "Database" => self::$Config->GetByDotKey("Database.Database"), "Charset" => self::$Config->GetByDotKey("Database.Charset"), ]); //SimpleRouter::csrfVerifier(new BaseCsrfVerifier()); SimpleRouter::setDefaultNamespace('app\Controllers'); VideoController::RegisterRoutes(); HomeController::RegisterRoutes(); AccountController::RegisterRoutes(); Logger::Info("Hajeebtok application initialized."); /* $hajeebtokAcc = new Account(username: "hajeebtok", password: "CENSORED", picture_hash: "default", verified: true, bio: "The best short form content platform!"); $hajeebtokAcc->Save(); $johnClapperAcc = new Account(username: "johnclapper", password: "CENSORED", picture_hash: "default", verified: true, bio: "My name is John Clapper. I clap everyone. I clap first at the cinema. No one else claps. Why does a jewish vrchat furry avatar bring a brisket to the vrchat furry convention? Because even in the metaverse they never show up empty handed!"); $johnClapperAcc->Save(); $hajeebtokVideo = new Video(title: "Habibi video", description: "πŸŒΉβ€β€β€πŸ˜πŸ˜πŸ˜πŸ’–πŸ’–πŸŽΆπŸŽΆβœŒβœŒ", author_id: 1, likes: 1000000, dislikes: 0); $hajeebtokVideo->Save(); */ SimpleRouter::error(function (Request $request, Exception $error) { Logger::Error("Route fault: $error"); $request->setRewriteCallback(function () use ($error) { return ErrorController::ApiError($error->getCode()); }); }); SimpleRouter::start(); } }