#How to make only one request when website build

2 messages · Page 1 of 1 (latest)

queen ferry
#

I created plugin like this: https://github.com/nuxt/nuxt.com/blob/main/plugins/stats.ts
but i get [error] [nitro] [unhandledRejection] [GET] "https://api.github.com/repos/xyz": 429 too many requests
xtimes on yarn generate.
I changed $fetch('https://api.nuxt.com/stats') to

 Promise.all([$fetch("https://api.github.com/repos/xyz"), $fetch("https://api.github.com/repos/xyz")]).then((data) => {
                data.forEach((el) => {
                    ghStars.value += el?.stargazers_count || 0
                })
            })
GitHub

The Nuxt website, made with Nuxt. Contribute to nuxt/nuxt.com development by creating an account on GitHub.