OptionalnameRequired for named middleware. The key name under which the middleware will be registered in the named middleware collection.
The import path to the middleware file. Can be a package import, subpath import, or relative path.
OptionalpositionThe position to add the middleware in the stack. 'before' adds at the beginning (runs first), 'after' adds at the end (runs last).
Entry to add a middleware to a given middleware stack via the CodeTransformer. Represents middleware configuration for server, router, or named middleware stacks.
Example