List of all current handlers
See original GitHub issueFeature
It would be helpful to know the list of active handlers at a given point of time. For eg. when used for testing, I would like to know already present handlers. It is a bit easier to debug. It could easy to track when server.use
is used to add more handlers.
Solution
It would be quite simple, API could be something like server.listHandlers()
, which would return all the active listeners.
Current Alternative
The current alternative is to use onUnhandledRequest
and kind of guess the typo in the request handler.
PS: I would be happy to give PR if this is a feature that others would want to have too.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:5 (5 by maintainers)
Top Results From Across the Web
logging.handlers — Logging handlers — Python 3.11.1 ...
The following useful handlers are provided in the package. Note that three of the handlers ( StreamHandler , FileHandler and NullHandler ) are...
Read more >apache2: Get a list of registered handlers - Server Fault
Is it possible, to get a list of all handlers from apache? With setHandler it is possible to create handlers.
Read more >how to get list of all registered synthetic event handlers ...
In this case, we filter all props with getListeners that start with "on" because every event listener in React starts with "on". You...
Read more >printHandlers() - Api - Mock Service Worker Docs
printHandlers (). Prints the list of currently active request handlers into the stdout of the running process.
Read more >Event handling (overview) - Event reference - MDN Web Docs
Programmers can create event handler code that will run when an event ... current document see the events sections in Window and Document...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can now list the current handlers with the
.printHandlers()
method.worker.printHandlers()
andserver.printHandlers()
Thank you for the suggestion, @balavishnuvj. This feature can be extremely useful.
this is awesome 🥳. I haven’t come across a use case for a matcher function yet, sounds useful though.
We can name it
handlers
,attachedHandlers
. Though I don’t huge DX issue even if itlist
orlistHandlers