reitit icon indicating copy to clipboard operation
reitit copied to clipboard

[Feature] Add handlers registry

Open bsless opened this issue 1 year ago • 2 comments

Just like middleware registry, but with a few open questions:

  • Should it be an opt of ring.core/router?
  • How should resolution be performed? Just postwalk and look for :handler?
    • Does that risk mangling input data?
    • Same for metadata (meta merge)
    • Can be done after merge but before compilation
  • Belong in core or ring?

bsless avatar Aug 26 '24 12:08 bsless

Quick comments:

  • base into reitit.middleware which defines concept of :handler, ring uses it
  • :handler paths are known in the :compile hook, different for middleware & ring, this is the way
  • maybe IntoHandler protocol?

ikitommi avatar Aug 27 '24 15:08 ikitommi

PR most welcome on this.

ikitommi avatar Jan 01 '25 12:01 ikitommi