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

Create health check endpoints #33

Closed
4 tasks
valiafetisov opened this issue Mar 30, 2023 · 4 comments · Fixed by #34
Closed
4 tasks

Create health check endpoints #33

valiafetisov opened this issue Mar 30, 2023 · 4 comments · Fixed by #34

Comments

@valiafetisov
Copy link
Contributor

valiafetisov commented Mar 30, 2023

Goal

Both of our services have /api/healthz get endpoints

Context

#30 (comment)

Tasks

  • Add /api/healthz endpoint to api
    • Make sure this endpoint connects to the database
  • Add /api/healthz endpoint to frontend
  • Add small note about them in the respective readmes
@KirillDogadin-std
Copy link
Contributor

Add /api/healthz endpoint to frontend

i'm struggling to understand what you mean by this. What is the user story here?
should frontend have its own api? should it just show a component with health? redirect response from the api?

@valiafetisov
Copy link
Contributor Author

What is the user story here?

I hoped that would be explained by the wording and the link under the context section. Kubernets needs something reachable in order to determine if it's alive or not. Therefore, the frontend (which is running a server anyway to serve html) also need to have similar endpoint, although it doesn't need to reach to the database or anywhere else

@KirillDogadin-std
Copy link
Contributor

Thanks for clarification.

One more thing:

we're still using sqlite and not psql, so if i remove the db file, startup the db, do select 1 - there will be no error + db file will be created. Same with pragme integrity_check query. I would then suggest doing a simple user query to make sure that there's "some" table

@valiafetisov
Copy link
Contributor Author

Yeah, I guess it's fine to query a table (and not return anything from the endpoint) to better validate that prisma client is properly initiated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants