Restores the /ping endpoint for health checks and adds 429 Too Many Requests response handling to improve API robustness.
23 lines
799 B
PHP
23 lines
799 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Illuminate\Support\Facades\Config;
|
|
use Illuminate\Support\Facades\Route;
|
|
use Presentation\Api\V1\Http\Controllers\Employees\EmployeeShowController;
|
|
use Presentation\Api\V1\Http\Controllers\Employees\EmployeesIndexController;
|
|
|
|
Route::get('/', fn () => response()->json([
|
|
'message' => Config::string('app.name') . ' v1',
|
|
'spec' => route('api.v1.openapi'),
|
|
]))->name('root');
|
|
|
|
|
|
Route::get('/openapi', function () {
|
|
return response()->file(
|
|
base_path('documentation/OpenApi/openapi.yaml'),
|
|
['Content-Type' => 'application/yaml']
|
|
);
|
|
})->name('openapi');
|
|
Route::get('/employees', EmployeesIndexController::class)->name('employees.index');
|
|
Route::get('/employees/{employeeId}', EmployeeShowController::class)->name('employees.show');
|