diff options
| author | Fuwn <[email protected]> | 2023-11-19 04:40:02 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-11-19 04:40:02 +0000 |
| commit | b1ad3406d280791ee4e6a3d9f029803d67219260 (patch) | |
| tree | 66a2e1fa53d0615421aa084dd5eb12641a071d3a /src/routes/api | |
| parent | fix(npm): remove lockfile (diff) | |
| download | frontend-next-b1ad3406d280791ee4e6a3d9f029803d67219260.tar.xz frontend-next-b1ad3406d280791ee4e6a3d9f029803d67219260.zip | |
feat(svelte): complete sveltekit upgrade
Diffstat (limited to 'src/routes/api')
| -rw-r--r-- | src/routes/api/+page.svelte | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/routes/api/+page.svelte b/src/routes/api/+page.svelte new file mode 100644 index 0000000..cf4e571 --- /dev/null +++ b/src/routes/api/+page.svelte @@ -0,0 +1,58 @@ +<!-- This file is part of api-worker <https://github.com/senpy-club/api-worker>. +Copyright (C) 2022-2022 Fuwn <[email protected]> + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 3. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. + +Copyright (C) 2022-2022 Fuwn <[email protected]> +SPDX-License-Identifier: GPL-3.0-only --> +<script> + import { onMount } from "svelte"; + import rst2html from "rst2html"; + import { baseURL } from "$lib/api"; + + let rst; + let complete = false; + + onMount(async () => { + rst = await (await fetch(baseURL)).text(); + complete = true; + }); +</script> + +<svelte:head> + <title>API | The Senpy Club</title> +</svelte:head> + +<section> + <p> + The Senpy Club API can be accessed through <a + href="https://api.senpy.club" + target="_blank" + > + REST + </a> + and + <a href="https://github.com/senpy-club/graphql-api" target="_blank" + >GraphQL</a + > + (<a href="https://graphql.senpy.club/playground" target="_blank"> + Playground</a + >) + </p> + + {#if !complete} + <p>Fetching API README ...</p> + {:else} + {@html rst2html(rst)} + {/if} +</section> |