我试图在官方文档中查找,但没有找到 express 的事件列表。
是否有像'route-matched'
这样的东西,所以我可以做app.on('route-matched', () => {})
?
编辑:在官方页面中,有mount
事件,当sup app挂载到parent app时调用。除此之外,没有链接,也没有信息可以在哪里找到支持的事件。
最佳答案
也许您指的是 Nodejs http.ServerResponse 事件?
如 Express js docs 中所述:
The res object is an enhanced version of Node’s own response object and supports all built-in fields and methods.
然后在 Node js docs :
Class: http.ServerResponse:
- Event: 'close'
- Event: 'finish'
关于javascript - express js事件列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40900270/