You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
provide some life cycle or event listener, so I can do something in that very time
Non-Goals
No response
Background
I want to log the total time for every incoming request. So far no easy way to do that except writing code in every route handler function.
Proposal
there is a serverLifeCycle.ts file in the app directory;
in this file, can export different life cycle, like: onAppStart, onAppReady, onAppEnd, onRequestStart, onRequestEnd, onResponseStart, onResponseEnd
for App life cycle, I can have some parameters to handle something related to the entire app. For request and response life cycle, I can access to the response and request object.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
provide some life cycle or event listener, so I can do something in that very time
Non-Goals
No response
Background
I want to log the total time for every incoming request. So far no easy way to do that except writing code in every route handler function.
Proposal
Beta Was this translation helpful? Give feedback.
All reactions