- • Cascading: each middleware gets
next(); runs code before and after downstream
- • Order is by
group, not registration: cors → parseBody → middleware
- • CORS & body parsers are chain entries, not bare
app.use
- • Body parsing configurable:
RestServerConfig.bodyParser
- • Mounted as the 1st Express handler in the
RestServer constructor
- • Matches upstream LB4
ExpressServer ("1st Express middleware")
- • Fronts
install* routes (/mcp, /console…) mounted before start()
- • Resolved lazily per request — late-bound middleware still join
- •
app.middleware(fn, {group, upstreamGroups, downstreamGroups})
- • Names:
RestMiddlewareGroups.{CORS, PARSE_BODY, MIDDLEWARE}
- • Topological sort via
sortListOfGroups() / MiddlewareView
- • ⚠ A
middleware-group fn pointing downstream at parseBody = cycle