-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: create health-check api call #977
chore: create health-check api call #977
Conversation
Hey! Those are your new endpoints: https://feat-lf8029jumpercreateahealth.jumper.exchange |
@@ -0,0 +1,7 @@ | |||
// API call: /meta/_health | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comment:
- please no "any"
- what about putting this inside an "api" folder ?
- we should specify "force-dynamic" for this one, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good points, thank you for the review!
1.) Good call, I did not use "req" at all and got rid of it.
2.) Please correct me: If I put this into another folder called "api", I will have to use middleware in order to match the required api-url "/meta/_health". Without the "api" folder, it seemed to be the easiest approach.
3.) I had to double-check and ask cody:
Do I need force-dynamic to not make this api route cachable?
No, you don't need to use force-dynamic for this API route. By default, Next.js API routes are not cached, and they are always server-rendered on every request.
The force-dynamic option is used for static pages (e.g., pages/index.tsx) to prevent them from being statically pre-rendered at build time. It forces the page to be dynamically rendered on every request, similar to an API route.
Since this file (@src/app/[lng]/meta/_health/route.ts) is an API route, it will always be dynamically rendered on every request, and there's no need to use force-dynamic.
…-for-the-devops-team
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…-for-the-devops-team
Ticket: https://lifi.atlassian.net/browse/LF-8029