Skip to content

Document CORS step in middleware pipeline #190

@VikramAditya33

Description

@VikramAditya33

The JSDoc for RouteRegistry.executeHandler lists the middleware pipeline as steps 1–5, but the actual code executes CORS handling as step 0 before guards. This makes the documentation inconsistent with the inline code comment (// 0. Handle CORS if enabled).

Just add step 0 to the JSDoc:

/**
 * Execute a route handler with middleware pipeline
 *
 * Executes the full middleware pipeline:
 * 0. CORS - Handle CORS headers and preflight
 * 1. Guards - Authorization checks
 * 2. Body parsing - Parse request body if present
 * 3. Pipes - Transform/validate body
 * 4. Handler - Execute route handler
 * 5. Exception filters - Handle errors
 *
 * @param handler - Route handler function
 * @param req - Request wrapper
 * @param res - Response wrapper
 * @param metadata - Optional middleware metadata
 */

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationgood first issueGood for newcomers

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions