aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/header/Header.svelte8
-rw-r--r--src/routes/api.svelte50
2 files changed, 51 insertions, 7 deletions
diff --git a/src/lib/header/Header.svelte b/src/lib/header/Header.svelte
index 671769e..77ef218 100644
--- a/src/lib/header/Header.svelte
+++ b/src/lib/header/Header.svelte
@@ -21,13 +21,7 @@ SPDX-License-Identifier: GPL-3.0-only -->
Route senpy[3] = [
<a sveltekit:prefetch href="/">home</a>,
<a sveltekit:prefetch href="/languages">languages</a>,
- <a
- sveltekit:prefetch
- href="https://api.senpy.club/"
- target="_blank"
- >
- api
- </a>
+ <a sveltekit:prefetch href="/api">api</a>
];
</nav>
</header>
diff --git a/src/routes/api.svelte b/src/routes/api.svelte
new file mode 100644
index 0000000..e167fa7
--- /dev/null
+++ b/src/routes/api.svelte
@@ -0,0 +1,50 @@
+<!-- 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";
+
+ let rst;
+ let complete = false;
+
+ onMount(async () => {
+ rst = await (await fetch("https://api.senpy.club")).text();
+ complete = true;
+ });
+</script>
+
+<svelte:head>
+ <title>API | The Senpy Club</title>
+</svelte:head>
+
+<section>
+ <h1>API</h1>
+
+ <p>This documentation is auto-generated, there may be errors.</p>
+
+ <p>
+ The Senpy Club API can be accessed at
+ <a href="https://api.senpy.club" target="_blank">https://api.senpy.club</a>.
+ </p>
+
+ {#if !complete}
+ <p>Fetching API README...</p>
+ {:else}
+ {@html rst2html(rst)}
+ {/if}
+</section>