fix: remove /api prefix from fireApiRoutes()
API routes are domain-scoped (api.lthn.ai, mcp.lthn.ai), not path-embedded. The /api prefix forced workarounds for Website modules that need stateless routes without path nesting. No other frontage (web, admin, client, mcp) enforced a path prefix — api was the odd one out. Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
f2c0c5f225
commit
c953ec7aac
1 changed files with 6 additions and 5 deletions
|
|
@ -76,7 +76,7 @@ use Livewire\Livewire;
|
|||
* ├─── Front/Api/Boot ────────────────────────────────────────────────── │
|
||||
* │ └── LifecycleEventProvider::fireApiRoutes() │
|
||||
* │ Fires: ApiRoutesRegistering │
|
||||
* │ Processes: routes ('api' middleware, '/api' prefix) │
|
||||
* │ Processes: routes ('api' middleware) │
|
||||
* │ │
|
||||
* ├─── Front/Client/Boot ─────────────────────────────────────────────── │
|
||||
* │ └── LifecycleEventProvider::fireClientRoutes() │
|
||||
|
|
@ -385,9 +385,10 @@ class LifecycleEventProvider extends ServiceProvider
|
|||
*
|
||||
* Called by Front/Api/Boot when REST API routes are being set up.
|
||||
*
|
||||
* Routes registered through this event are automatically:
|
||||
* - Wrapped with the 'api' middleware group
|
||||
* - Prefixed with '/api'
|
||||
* Routes registered through this event are automatically wrapped
|
||||
* with the 'api' middleware group (stateless, no CSRF).
|
||||
* No prefix is applied — API routes live on domain-scoped subdomains
|
||||
* (e.g., api.lthn.ai/v1/brain/recall).
|
||||
*/
|
||||
public static function fireApiRoutes(): void
|
||||
{
|
||||
|
|
@ -396,7 +397,7 @@ class LifecycleEventProvider extends ServiceProvider
|
|||
|
||||
// Process route requests with api middleware
|
||||
foreach ($event->routeRequests() as $callback) {
|
||||
Route::middleware('api')->prefix('api')->group($callback);
|
||||
Route::middleware('api')->group($callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue