23 lines
475 B
Svelte
23 lines
475 B
Svelte
|
|
<script lang="ts">
|
||
|
|
import apiFetch from "$lib/api";
|
||
|
|
import { onMount } from "svelte";
|
||
|
|
|
||
|
|
let guildCount: number | null = 0;
|
||
|
|
|
||
|
|
type MetaResponse = { guilds: number };
|
||
|
|
|
||
|
|
onMount(async () => {
|
||
|
|
const meta = await apiFetch<MetaResponse>("GET", "/api/meta");
|
||
|
|
guildCount = meta.guilds;
|
||
|
|
});
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<h1>Welcome to SvelteKit</h1>
|
||
|
|
<p>
|
||
|
|
Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation
|
||
|
|
</p>
|
||
|
|
|
||
|
|
<p>
|
||
|
|
In {guildCount ?? "(loading)"} servers!
|
||
|
|
</p>
|