-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Find an alternative in case of HTTP 400 too many request
, when attendees need to use more than 10k requests offered by Stackoverflow API.
Elements of resolution:
- Do an HTTP call to static JSON file
- cache requests in locale/session storage
export function get (shortUrl) {
if (window.sessionStorage.getItem(shortUrl)) {
return Promise.resolve(JSON.parse(window.sessionStorage.getItem(shortUrl)))
}
const fullUrl = `${process.env.GITHUB_URL}/${shortUrl}`
return axios.get(fullUrl, getOAuthTokens()).then(response => {
window.sessionStorage.setItem(shortUrl, JSON.stringify(response.data))
return response.data
})
}
Metadata
Metadata
Assignees
Labels
No labels