Initial version
This commit is contained in:
18
memes/src/routes/+page.ts
Normal file
18
memes/src/routes/+page.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
// since there's no dynamic data here, we can prerender
|
||||
// it so that it gets served as a static asset in production
|
||||
export const prerender = true;
|
||||
|
||||
import type { PageLoad } from './$types';
|
||||
import { dev } from '$app/environment';
|
||||
|
||||
export const load = (async ({fetch}) => {
|
||||
if (dev) {
|
||||
return {
|
||||
"max": 1000
|
||||
}
|
||||
}
|
||||
const res = await fetch('https://shoebottom.ca/host/memes/max.json')
|
||||
const json = await res.json()
|
||||
return json
|
||||
}) satisfies PageLoad;
|
||||
|
||||
Reference in New Issue
Block a user