feat: initial commit

This commit is contained in:
Cory Dransfeldt 2025-03-27 16:46:02 -07:00
commit e214116e40
No known key found for this signature in database
253 changed files with 17406 additions and 0 deletions

33
src/data/recentMedia.js Normal file
View file

@ -0,0 +1,33 @@
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
const fetchRecentMedia = async () => {
try {
const data = await EleventyFetch(
`${POSTGREST_URL}/optimized_recent_media?select=*`,
{
duration: "1h",
type: "json",
fetchOptions: {
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`,
},
},
},
);
const [{ recent_activity } = {}] = data;
return recent_activity || [];
} catch (error) {
console.error("Error fetching recent media data:", error);
return [];
}
};
export default async function () {
return await fetchRecentMedia();
}