mirror of
https://github.com/System-End/site.git
synced 2026-04-19 19:45:07 +00:00
10 lines
284 B
JavaScript
10 lines
284 B
JavaScript
export default async function getGames(req, res) {
|
|
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 res.json(games)
|
|
}
|