Dynamic sitemap generation :)
All checks were successful
pipeline / build-and-push-images (push) Successful in 30s
pipeline / deploy (push) Successful in 10s

This commit is contained in:
2024-12-02 19:35:49 +01:00
parent f2c2709fe7
commit 31182faa45
2 changed files with 22 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import { CDRAGON_BASE } from "~/utils/cdragon";
async function championRoutes() {
const championsData : Array<Champion> = await
(await fetch(CDRAGON_BASE + "plugins/rcp-be-lol-game-data/global/default/v1/champion-summary.json")).json()
let routes : Array<string> = []
for(let champion of championsData) {
routes.push("/champion/" + champion.alias.toLowerCase())
}
return routes
}
export default defineEventHandler(async (_) => {
const data = await championRoutes();
return data
})