Skip to content
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

Conversation

dennyscode
Copy link
Contributor

@dennyscode dennyscode added the feature This label will create a dedicated Feature environment label May 16, 2024
Copy link

Hey! Those are your new endpoints: https://feat-lf8029jumpercreateahealth.jumper.exchange

@@ -0,0 +1,7 @@
// API call: /meta/_health

Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Member

@oktapodia oktapodia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dennyscode dennyscode merged commit f70e0bf into develop May 22, 2024
1 check passed
@dennyscode dennyscode deleted the LF-8029-jumper-create-a-healthcheck-route-for-the-devops-team branch May 22, 2024 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This label will create a dedicated Feature environment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants