diff --git a/public/index.php b/public/index.php
index d85d1bd..250e796 100644
--- a/public/index.php
+++ b/public/index.php
@@ -31,10 +31,10 @@ $app->get('/docs', function ($request, $response) {
$docsPath = __DIR__ . '/docs/index.html';
if (!file_exists($docsPath)) {
+ $response->getBody()->write('
Documentation not found
');
return $response
->withStatus(404)
- ->withHeader('Content-Type', 'text/html')
- ->getBody()->write('Documentation not found
');
+ ->withHeader('Content-Type', 'text/html');
}
$html = file_get_contents($docsPath);
@@ -48,10 +48,10 @@ $app->get('/docs/openapi.json', function ($request, $response) {
$openApiPath = __DIR__ . '/docs/openapi.json';
if (!file_exists($openApiPath)) {
+ $response->getBody()->write(json_encode(['error' => 'OpenAPI spec not found']));
return $response
->withStatus(404)
- ->withHeader('Content-Type', 'application/json')
- ->getBody()->write(json_encode(['error' => 'OpenAPI spec not found']));
+ ->withHeader('Content-Type', 'application/json');
}
$json = file_get_contents($openApiPath);