API-Doku: OpenAPI-Spec aus public/ statt geloeschtem docs/ ausliefern
Der docs/-Mount kam nicht mit; die Route /docs/api/v1 lief dadurch auf 500. Liest jetzt public/api/v1.yml mit 404-Guard. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f11e8aab7c
commit
07e0bc598e
2 changed files with 318 additions and 1 deletions
|
|
@ -283,7 +283,11 @@ Route::get('/robots.txt', function () {
|
|||
// Sprach-/Edition-unabhängige Routen (API-Doku).
|
||||
// ---------------------------------------------------------------------------
|
||||
Route::get('/docs/api/v1', function () {
|
||||
return response((string) file_get_contents(base_path('docs/api/v1.yml')), 200, [
|
||||
$path = public_path('api/v1.yml');
|
||||
|
||||
abort_unless(is_file($path), 404);
|
||||
|
||||
return response((string) file_get_contents($path), 200, [
|
||||
'Content-Type' => 'application/yaml; charset=UTF-8',
|
||||
]);
|
||||
})->name('docs.api.v1');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue