21 lines
521 B
TypeScript
21 lines
521 B
TypeScript
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()
|
|
|
|
const routes: Array<string> = []
|
|
for (const champion of championsData) {
|
|
routes.push('/champion/' + champion.alias.toLowerCase())
|
|
}
|
|
return routes
|
|
}
|
|
|
|
export default defineEventHandler(async _ => {
|
|
const data = await championRoutes()
|
|
return data
|
|
})
|