tsk-51: Send message endpoint (#52)

Closes #51

Reviewed-on: phoenix/textsender-api#52
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
phoenix
2025-12-10 21:35:02 +00:00
committed by phoenix
parent 20ffc45f89
commit 0d252bc261
32 changed files with 753 additions and 96 deletions
+5
View File
@@ -16,7 +16,12 @@ func ExtractFromRequest(r *http.Request, reqItem interface{}) error {
}
}
func InvalidJson(err error) string {
return fmt.Sprintf("Invalid JSON: %s", err.Error())
}
// Helper function to send JSON responses
// TODO: Change type of data to any
func RespondWithJSON(w http.ResponseWriter, statusCode int, data interface{}) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(statusCode)