I tried to find in the official documentation but have found no list of events for express.
Is there such a thing like 'route-matched'
so I can do app.on('route-matched', () => {})
?
Edit: in the official page, there was mount
event, which is called when sup app mount on parent app. Beside this there is no link no information where to find the supported events.
As you may know, Node. js is evented, thus listening for events (pub-sub), just like jQuery or Backbone for example. In Node. js, you usually bind functions (using 'on' or other functions) to listen to events.
Emitting events: Every event is named event in nodejs. We can trigger an event by emit(event, [arg1], [arg2], […]) function. We can pass an arbitrary set of arguments to the listener functions.
Express is currently, and for many years, the de-facto library in the Node. js ecosystem. When you are looking for any tutorial to learn Node, Express is presented and taught to people.
Maybe you refer to the Nodejs http.ServerResponse events?
As stated in the Express js docs:
The res object is an enhanced version of Node’s own response object and supports all built-in fields and methods.
And then in the Node js docs:
Class: http.ServerResponse:
- Event: 'close'
- Event: 'finish'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With