- POST /v1/gateway/pair — register with capabilities, region, endpoints - POST /v1/gateway/heartbeat — report alive + load + bytes (60s interval) - GET /v1/gateway/live — real-time paired gateway list - POST /v1/gateway/dispatch — least-loaded gateway selection - GatewayRegistry: TTL liveness, load-based selection - Foundation for LetheanGateway binary using core/api + go-ratelimit Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
16 lines
601 B
PHP
16 lines
601 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
use Mod\Gateway\Controllers\GatewayController;
|
|
|
|
// Gateway node endpoints (authenticated — gateway uses its own API key)
|
|
Route::post('/pair', [GatewayController::class, 'pair'])->middleware('auth.api');
|
|
Route::post('/heartbeat', [GatewayController::class, 'heartbeat'])->middleware('auth.api');
|
|
|
|
// Public endpoints
|
|
Route::get('/live', [GatewayController::class, 'live']);
|
|
|
|
// Internal dispatch (authenticated — called by proxy module)
|
|
Route::post('/dispatch', [GatewayController::class, 'dispatch'])->middleware('auth.api');
|