Build-phase middleware: registers the two contract routes, with their paths taken from
configuration.
A middleware rather than static route definitions on the blueprint, because the paths are
configurable and the blueprint constant is evaluated before the application has said anything.
Reading configuration is only safe once everything has been collected, which is why it reads
AFTER next, and it returns what next returned: a build-phase middleware that returns its own
value replaces the blueprint for every later phase.
Both routes are added to stone.router.definitions, the same array the router scans, so nothing
here depends on the router package itself.
Build-phase middleware: registers the two contract routes, with their paths taken from configuration.
A middleware rather than static route definitions on the blueprint, because the paths are configurable and the blueprint constant is evaluated before the application has said anything. Reading configuration is only safe once everything has been collected, which is why it reads AFTER
next, and it returns whatnextreturned: a build-phase middleware that returns its own value replaces the blueprint for every later phase.Both routes are added to
stone.router.definitions, the same array the router scans, so nothing here depends on the router package itself.