safeLoad(); } error_reporting(E_ALL); use FrameworkX\App; use Middlewares\ExternalAuthMiddleware; use Libs\ModelFactory; try { $adb = ModelFactory::adb(); $GLOBALS['ADB'] = $adb; } catch (\Throwable $e) { http_response_code(500); header('Content-Type: application/json; charset=utf-8'); echo json_encode(['error' => 'DB init failed', 'detail' => $e->getMessage()], JSON_UNESCAPED_SLASHES); exit(1); } $app = new App(); $authExternal = new ExternalAuthMiddleware(); $app->get('/hello', $authExternal, \Controllers\HelloController::class); $app->post('/send/mail', $authExternal, \Controllers\MailSendController::class); $app->run();