diff --git a/api_candidatos/api/index.php b/api_candidatos/api/index.php index bf4aa43..52fd475 100644 --- a/api_candidatos/api/index.php +++ b/api_candidatos/api/index.php @@ -24,7 +24,19 @@ $normalizedPath = str_replace($basePath, '', $path); // Enrutamiento switch (true) { case preg_match('#^/oauth/token#', $normalizedPath): - require_once __DIR__ . '/../src/Oauth/Routes/AuthRoutes.php'; + $authPath = __DIR__ . '/../src/Oauth/Routes/AuthRoutes.php'; + + if (file_exists($authPath)) { + require_once $authPath; + } else { + http_response_code(500); + echo json_encode([ + 'error' => 'Archivo AuthRoutes.php no encontrado', + 'ruta_buscada' => $authPath + ]); + exit; + } + // /../src/candidatos/index.php break;