Skip to content

Conversation

@lucasnevespereira
Copy link
Collaborator

@lucasnevespereira lucasnevespereira commented Jun 28, 2025

📝 Description

This PR introduces the following improvements:

  • Health Check Route: Adds a dedicated /api/health endpoint to verify API availability and service health.
  • Exercises API Route: Wraps the getExercises action within a new API route.

✅ Testing

1. Valid Request — Exercises Found

Request:

http POST http://localhost:3000/api/exercises
muscles:='["CHEST", "FULL_BODY", "GLUTES"]'
equipment:='["BODYWEIGHT", "BARBELL", "BENCH"]'
limit:=5

Response:

  • Status: 200 OK
  • Body: Returns a list of matching exercises.

2. Invalid Input — Enum Validation

Request:

http POST http://localhost:3000/api/exercises
muscles:='["TOTO"]'
equipment:='["BODYWEIGHT", "BARBELL", "BENCH"]'
limit:=5

Response:

  • Status: 400 Bad Request
  • Body: Provides detailed validation errors, including the invalid enum value.

3. No Exercises Found

Request:

http POST http://localhost:3000/api/exercises
muscles:='["ADDUCTORS"]'
equipment:='["CROSSFIT"]'
limit:=5

Response:

  • Status: 404 Not Found
  • Body: Returns an error message indicating no exercises were found.

ℹ️ Notes

  • All scenarios above were tested locally and are working as expected.
  • The new health check route can be used for uptime monitoring and deployment readiness checks.

@vercel
Copy link

vercel bot commented Jun 28, 2025

@lucasnevespereira is attempting to deploy a commit to the Workoutcool Team Team on Vercel.

A member of the Team first needs to authorize it.

@lucasnevespereira lucasnevespereira marked this pull request as draft June 28, 2025 14:15
@lucasnevespereira lucasnevespereira changed the title chore: wrap get-exercises actions in api route chore: wrap actions in api routes Jun 28, 2025
@lucasnevespereira lucasnevespereira force-pushed the chore/actions-to-api branch 2 times, most recently from 1ec6444 to 88f0d3a Compare June 28, 2025 15:23
@lucasnevespereira lucasnevespereira changed the title chore: wrap actions in api routes chore: wrap get exercise actions in api route Jun 28, 2025
@lucasnevespereira lucasnevespereira marked this pull request as ready for review June 28, 2025 15:24
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 this pull request may close these issues.

1 participant