Expose public Scalar API docs
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Laravel\Fortify\Features;
|
||||
|
||||
@@ -7,6 +9,16 @@ Route::inertia('/', 'Welcome', [
|
||||
'canRegister' => Features::enabled(Features::registration()),
|
||||
])->name('home');
|
||||
|
||||
Route::get('api/docs/openapi.json', function (): Response {
|
||||
$path = base_path('docs/openapi/kanbangit-api.openapi.json');
|
||||
|
||||
abort_unless(File::exists($path), 404);
|
||||
|
||||
return response(File::get($path), 200, [
|
||||
'Content-Type' => 'application/vnd.oai.openapi+json; charset=utf-8',
|
||||
]);
|
||||
})->name('api.docs.openapi');
|
||||
|
||||
Route::middleware(['auth', 'verified'])->group(function () {
|
||||
Route::inertia('dashboard', 'Dashboard')->name('dashboard');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user