Closed JohnathonBowers closed 3 months ago
Could you give me an example? Both API requests done to the GitHub API (using the octokit
library ) or our OpenSearch_Changelog_PR_Bridge
service use HTTPS in production mode.
If we want to reduce duplication for the requests done to the OpenSearch_Changelog_PR_Bridge
service we can implement an axios
instance instead. But for the case of the API requests to the GitHub API, the octokit
instance wraps all the required logic for sending these requests.
Sorry, @BigSamu . I should have clarified what I meant. I created this issue mainly as a placeholder for something to come back to when we have time. The API calls I had in mind are the ones we make to the OpenSearch_Changelog_PR_Bridge
service. And, yes, creating an axios
instance would be along the lines of what I had in mind.
Yeah, creating an axios
instance is a good way to go for reducing repetition. Good call!
This is already addressed in release v1.0.0-alpha
Right now, we are duplicating code with our HTTP requests. It would be good to create an HTTP service and an API service to enable better maintainability and separation of concerns.