mirror of
https://github.com/System-End/site.git
synced 2026-04-19 19:45:07 +00:00
15 lines
384 B
JavaScript
15 lines
384 B
JavaScript
export async function getGames() {
|
|
let games = await fetch(
|
|
'https://raw.githubusercontent.com/hackclub/sprig/main/games/metadata.json'
|
|
).then(res => res.json())
|
|
games = games
|
|
.sort((a, b) => new Date(b.addedOn) - new Date(a.addedOn))
|
|
.slice(-4)
|
|
|
|
return games
|
|
}
|
|
|
|
export default async function Games(req, res) {
|
|
const games = await getGames()
|
|
res.json(games)
|
|
}
|