Loheide-eu-mitarbeiterplatt.../routes/api.php
Friederich Loheide b3e2b525e1
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 6m10s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Failing after 6m3s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 7m33s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 7m25s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 7m28s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 7m27s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 6m26s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 6m27s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 44s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m12s
Herzen, Reichweite und App-Anbindung (0.30.0)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 12:24:11 +00:00

36 lines
1.6 KiB
PHP

<?php
use App\Http\Controllers\Api\AppController;
use App\Http\Controllers\Api\AuthController;
use App\Http\Controllers\Api\NotificationController;
use App\Http\Controllers\Api\PeopleController;
use App\Http\Controllers\Api\SearchController;
use Illuminate\Support\Facades\Route;
/*
* REST-API für Apps (docs/API.md). Anmeldung mit persönlichem Zugangs-Token:
* Authorization: Bearer <token>
* Plugins ergänzen eigene Endpunkte über routes/api.php (ebenfalls unter /api/v1).
*/
Route::prefix('v1')->group(function () {
Route::post('/token', [AuthController::class, 'token'])->middleware('throttle:10,1');
Route::post('/token/exchange', [AppController::class, 'exchange'])->middleware('throttle:10,1');
Route::get('/config', [AppController::class, 'config'])->middleware('throttle:60,1');
Route::middleware('auth:sanctum')->group(function () {
Route::get('/me', [AuthController::class, 'me']);
Route::delete('/token', [AuthController::class, 'revoke']);
Route::get('/notifications', [NotificationController::class, 'index']);
Route::post('/notifications/read', [NotificationController::class, 'readAll']);
Route::post('/notifications/{id}/read', [NotificationController::class, 'read']);
Route::get('/people', [PeopleController::class, 'index']);
Route::get('/people/{user}', [PeopleController::class, 'show'])->whereNumber('user');
Route::get('/search', SearchController::class);
Route::post('/push/devices', [AppController::class, 'registerDevice'])->middleware('throttle:30,1');
Route::delete('/push/devices', [AppController::class, 'removeDevice']);
});
});