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