Skip to content
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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

JamesHillyard
Copy link

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

  • Tested and/or added tests to validate that the changes work as intended, if applicable.
  • Updated documentation in README.md, if applicable.

JamesHillyard and others added 4 commits May 9, 2024 11:57
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>
Copy link
Owner

@TwiN TwiN left a 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 😅

@TwiN TwiN changed the title Expose Raw Uptime Data via API feat: Expose uptime data as text via API May 10, 2024
@TwiN TwiN changed the title feat: Expose uptime data as text via API feat(api): Expose uptime data as text via API May 10, 2024
@TwiN TwiN added feature New feature or request area/api Related to the REST API labels May 10, 2024
Signed-off-by: James Hillyard <james.hillyard@payara.fish>
@JamesHillyard
Copy link
Author

No worries, thanks for letting me know! Hopefully it's all sorted 😄

@JamesHillyard JamesHillyard requested a review from TwiN May 10, 2024 08:45
return c.Status(500).SendString(err.Error())
}

c.Set("Content-Type", "text/html")
Copy link
Owner

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())
}

Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Related to the REST API feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants