Adds a loading animation

This commit is contained in:
Alicia Sykes committed 2023-07-23 00:05:04 +01:00
1 parent 79afd4a46d
commit 573864baae
3 files changed
+104 -2

No files matched your search

+8
View File
@@ -11,6 +11,14 @@ exports.handler = function(event, context, callback) {
}
const apiKey = process.env.GOOGLE_CLOUD_API_KEY;
if (!apiKey) {
callback(null, {
statusCode: 500,
body: JSON.stringify({ error: 'API key (GOOGLE_CLOUD_API_KEY) not set'}),
});
}
const endpoint = `https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=${encodeURIComponent(url)}&category=PERFORMANCE&category=ACCESSIBILITY&category=BEST_PRACTICES&category=SEO&category=PWA&strategy=mobile&key=${apiKey}`;
axios.get(endpoint)