Skip to content

Commit

Permalink
Update Documentation.php
Browse files Browse the repository at this point in the history
  • Loading branch information
freost committed Mar 4, 2025
1 parent 4655fa3 commit e48544d
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/http/controllers/Documentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,9 @@ public function elements(URLBuilder $uRLBuilder): string
const docs = document.getElementById('docs');
let text = await fetch('$specUrl').then(res => res.text())
if (!text.includes('servers')) {
try {
const json = JSON.parse(text);
text = JSON.stringify({ servers: [{ url: '$apiBaseUrl' }], ...json });
} catch (e) {
text = `servers:
- url: $apiBaseUrl
` + text;
}
text = `servers:
- url: $apiBaseUrl
` + text;
}
docs.apiDescriptionDocument = text;
})();
Expand Down

0 comments on commit e48544d

Please sign in to comment.