]> git.lizzy.rs Git - frontend-next.git/blob - src/routes/api.svelte
feat: image homepages
[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, rstTime;
24   let complete = false;
25
26   onMount(async () => {
27     rstTime = performance.now();
28     rst = await (await fetch(baseURL)).text();
29     rstTime = performance.now() - rstTime;
30     complete = true;
31   });
32 </script>
33
34 <svelte:head>
35   <title>API | The Senpy Club</title>
36 </svelte:head>
37
38 <section>
39   <h1>API</h1>
40
41   <p>This documentation is auto-generated, there may be errors.</p>
42
43   <p>
44     The Senpy Club API can be accessed at
45     <a href="https://api.senpy.club" target="_blank">https://api.senpy.club</a>.
46   </p>
47
48   {#if !complete}
49     <p>Fetching API README...</p>
50   {:else}
51     {@html rst2html(rst)}
52     <p>Double rst_to_html_time = {rstTime}; /* ms */</p>
53   {/if}
54 </section>