From 91542fb00992e7fba96ec3230be505f4904bdb95 Mon Sep 17 00:00:00 2001 From: Snider Date: Tue, 3 Mar 2026 17:08:51 +0000 Subject: [PATCH] revert: simplify route file back to single config read Multi-domain logic moved to app-level Boot (wildcard override). Co-Authored-By: Virgil --- src/Website/Mcp/Routes/web.php | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/Website/Mcp/Routes/web.php b/src/Website/Mcp/Routes/web.php index ba2c815..6103e84 100644 --- a/src/Website/Mcp/Routes/web.php +++ b/src/Website/Mcp/Routes/web.php @@ -6,19 +6,18 @@ use Core\Website\Mcp\Controllers\McpRegistryController; /* |-------------------------------------------------------------------------- -| MCP Portal Routes (mcp.host.uk.com / mcp.lthn.test etc.) +| MCP Portal Routes |-------------------------------------------------------------------------- | | Public routes for the MCP server registry and documentation portal. | These routes serve both human-readable docs and machine-readable JSON. | -| Supports multiple domains via config('mcp.domains'). +| Domain is set via config('mcp.domain') — the app Boot may override +| this with a wildcard for multi-domain support. | */ -$mcpDomains = config('mcp.domains', [config('mcp.domain', 'mcp.host.uk.com')]); - -$registerMcpRoutes = function () { +Route::domain(config('mcp.domain'))->name('mcp.')->group(function () { // Agent discovery endpoint (always JSON) Route::get('.well-known/mcp-servers.json', [McpRegistryController::class, 'registry']) ->name('registry'); @@ -47,12 +46,4 @@ $registerMcpRoutes = function () { // OpenAPI spec Route::get('openapi.json', [McpRegistryController::class, 'openapi'])->name('openapi.json'); Route::get('openapi.yaml', [McpRegistryController::class, 'openapi'])->name('openapi.yaml'); -}; - -// Primary domain gets named routes (mcp.landing, mcp.servers.index, etc.) -Route::domain($mcpDomains[0])->name('mcp.')->group($registerMcpRoutes); - -// Additional domains get the same routes without named duplicates -foreach (array_slice($mcpDomains, 1) as $domain) { - Route::domain($domain)->group($registerMcpRoutes); -} +});