Skip to content

Update/Add Endpoints for Frontend#35

Merged
Mitchell-UCF-Git merged 7 commits intomainfrom
update-endpoints
Apr 5, 2025
Merged

Update/Add Endpoints for Frontend#35
Mitchell-UCF-Git merged 7 commits intomainfrom
update-endpoints

Conversation

@psmit03
Copy link
Member

@psmit03 psmit03 commented Apr 4, 2025

  • fix CORS Access issues with API
  • add endpoint for fetching wakeword from frontend: /config/keyword
  • fix endpoints to work across all subdirectories within config

@psmit03 psmit03 marked this pull request as ready for review April 4, 2025 21:49
Copilot AI review requested due to automatic review settings April 4, 2025 21:49
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

// Return the keyword from the SpeechToText configuration
_, err := w.Write([]byte(config.SpeechToText.Keyword))
if err != nil {
log.Fatal("Failed to write response:", err)
Copy link

Copilot AI Apr 4, 2025

Choose a reason for hiding this comment

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

Using log.Fatal in getKeywordHandler terminates the entire API server on a write error which could lead to service downtime. Consider sending an HTTP error response (e.g., using http.Error) instead.

Suggested change
log.Fatal("Failed to write response:", err)
http.Error(w, "Failed to write response", http.StatusInternalServerError)
return

Copilot uses AI. Check for mistakes.
@psmit03 psmit03 changed the title Update/Add Endpoints Update/Add Endpoints for Frontend Apr 5, 2025
Copy link
Contributor

@Mitchell-UCF-Git Mitchell-UCF-Git left a comment

Choose a reason for hiding this comment

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

Looks good

@Mitchell-UCF-Git Mitchell-UCF-Git merged commit 68320e9 into main Apr 5, 2025
1 check passed
@psmit03 psmit03 deleted the update-endpoints branch April 5, 2025 17:45
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.

3 participants