-
-
Notifications
You must be signed in to change notification settings - Fork 385
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
feat(api): Expose uptime data as text via API #758
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: James Hillyard <james.hillyard@payara.fish>
Signed-off-by: James Hillyard <james.hillyard@payara.fish>
Signed-off-by: James Hillyard <james.hillyard@payara.fish>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just FYI, I made a few changes in #759 that breaks your code, namely, the core
package has been moved to config/endpoint
.
Sorry about the inconvenience 😅
Signed-off-by: James Hillyard <james.hillyard@payara.fish>
No worries, thanks for letting me know! Hopefully it's all sorted 😄 |
return c.Status(500).SendString(err.Error()) | ||
} | ||
|
||
c.Set("Content-Type", "text/html") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be text/plain
?
} | ||
return c.Status(500).SendString(err.Error()) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary
Exposes the uptime data in it's raw format as plaintext in the API for third-party consumption. Implements feature request #757
This code is very similar to the code used to fetch the data in
/api/badges.go
Checklist
README.md
, if applicable.