]> git.lizzy.rs Git - frontend-next.git/blob - src/routes/api.svelte
89896e7fe77fa4452f446f8900f3d695c0a8e224
[frontend-next.git] / src / routes / api.svelte
1 <!-- This file is part of api-worker <https://github.com/senpy-club/api-worker>.
2 Copyright (C) 2022-2022 Fuwn <contact@fuwn.me>
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, version 3.
7
8 This program is distributed in the hope that it will be useful, but
9 WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16 Copyright (C) 2022-2022 Fuwn <contact@fuwn.me>
17 SPDX-License-Identifier: GPL-3.0-only -->
18 <script>
19   import { onMount } from "svelte";
20   import rst2html from "rst2html";
21   import { baseURL } from "$lib/api";
22
23   let rst;
24   let complete = false;
25
26   onMount(async () => {
27     rst = await (await fetch(baseURL)).text();
28     complete = true;
29   });
30 </script>
31
32 <svelte:head>
33   <title>API | The Senpy Club</title>
34 </svelte:head>
35
36 <section>
37   <h1>API</h1>
38
39   <p>This documentation is auto-generated, there may be errors.</p>
40
41   <p>
42     The Senpy Club API can be accessed at
43     <a href="https://api.senpy.club" target="_blank">https://api.senpy.club</a>.
44   </p>
45
46   {#if !complete}
47     <p>Fetching API README...</p>
48   {:else}
49     {@html rst2html(rst)}
50   {/if}
51 </section>