This PR adds a new endpoint to the backend API that allows checking the health of the API. The endpoint is accessible at /api/health and returns a JSON response with a status of 'OK' if the API is healthy. If there is any exception while processing the request, the endpoint will return a 500 status code with a detail message indicating that the API is not healthy.
Summary of Changes
Added a new view function named health_check in demo/web/api/monitoring/views.py that returns a JSON response indicating the health status of the API.
Modified demo/web/api/router.py to include a new route mapping the path /health to the health_check function.
Updated demo/tests/test_demo.py to include tests for the new health check endpoint.
Added relevant imports and assertions in the modified files.
Please review and merge this PR to add the health check endpoint to the backend API.
Fixes #6.
🎉 Latest improvements to Sweep:
Sweep can now passively improve your repository! Check out Rules to learn more.
💡 To get Sweep to edit this pull request, you can:
Comment below, and Sweep can edit the entire PR
Comment on a file, Sweep will only modify the commented file
Edit the original issue to get Sweep to recreate the PR from scratch
PR Feedback (click)
Description
This PR adds a new endpoint to the backend API that allows checking the health of the API. The endpoint is accessible at
/api/health
and returns a JSON response with a status of 'OK' if the API is healthy. If there is any exception while processing the request, the endpoint will return a 500 status code with a detail message indicating that the API is not healthy.Summary of Changes
health_check
indemo/web/api/monitoring/views.py
that returns a JSON response indicating the health status of the API.demo/web/api/router.py
to include a new route mapping the path/health
to thehealth_check
function.demo/tests/test_demo.py
to include tests for the new health check endpoint.Please review and merge this PR to add the health check endpoint to the backend API.
Fixes #6.
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can: