Implement caching in the patch_detector, consume the cache from API routes in frontend
17 lines
416 B
TypeScript
17 lines
416 B
TypeScript
import { getChampionSummary } from '~/server/utils/cdragon-cache'
|
|
|
|
async function championRoutes() {
|
|
const championsData = await getChampionSummary()
|
|
|
|
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
|
|
})
|