2.3 KiB
2.3 KiB
Configurable Route Table - Static File Serving
Module
Gateway
Status
VERIFIED
Description
The Gateway supports a StaticFile route type that serves a single specific file at an exact path. Configured via StellaOpsRoute with Type = StaticFile, Path = exact URL path (e.g., /favicon.ico), TranslatesTo = physical file path. Sub-paths are rejected (e.g., /favicon.ico/extra returns 404). The file is served with the correct MIME type inferred from the file extension.
Implementation Details
- Modules:
src/Router/__Libraries/StellaOps.Router.Gateway/,src/Router/StellaOps.Gateway.WebService/ - Key Classes:
StellaOpsRoute(src/Router/__Libraries/StellaOps.Router.Gateway/Configuration/StellaOpsRoute.cs) - Route model withStellaOpsRouteType.StaticFileStellaOpsRouteResolver(src/Router/StellaOps.Gateway.WebService/Routing/StellaOpsRouteResolver.cs) - Resolves exact path match for StaticFile routesRouteDispatchMiddleware(src/Router/StellaOps.Gateway.WebService/Middleware/RouteDispatchMiddleware.cs) -HandleStaticFilemethod serves exact file with MIME detectionGatewayOptionsValidator(src/Router/StellaOps.Gateway.WebService/Configuration/GatewayOptionsValidator.cs) - Validates StaticFile route has non-empty TranslatesTo file path
- Tests:
RouteTableIntegrationTests(src/Router/__Tests/StellaOps.Gateway.WebService.Tests/Integration/RouteTableIntegrationTests.cs) - 3 StaticFile integration testsGatewayOptionsValidatorTests(src/Router/__Tests/StellaOps.Gateway.WebService.Tests/Configuration/GatewayOptionsValidatorTests.cs) - StaticFile validation tests
E2E Test Plan
- Serve a single file:
GET /favicon.icoreturns file content with 200 - Reject sub-paths:
GET /favicon.ico/extrareturns 404 - Correct Content-Type:
GET /favicon.icoreturnsContent-Type: image/x-icon
Verification
- Run ID: run-001
- Date: 2026-02-12
- Method: Tier 0 source verification + Tier 1 build/code review (224/224 tests pass) + Tier 2a live HTTP API testing
- Build: PASS (0 errors, 0 warnings)
- Tests: PASS (224/224 Gateway tests pass)
- Tier 2a Evidence:
docs/qa/feature-checks/runs/gateway/configurable-route-table-static-file-serving/run-001/tier2-api-check.json - Verdict: PASS