Adds API docs route

This commit is contained in:
Alicia Sykes 2024-05-19 11:55:00 +01:00
parent 891982321c
commit d2f58f40b5
2 changed files with 2898 additions and 0 deletions

File diff suppressed because it is too large Load Diff

42
src/pages/docs-api.astro Normal file
View File

@ -0,0 +1,42 @@
---
import BaseLayout from '@layouts/Base.astro';
---
<BaseLayout title="API Docs | Web Check">
<Fragment slot="head">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.1.3/swagger-ui.css">
<link rel="stylesheet" href="https://rawcdn.githack.com/Amoenus/SwaggerDark/2064ccd45b571865a64c731fa6bfddfbf2a01fe1/SwaggerDark.css">
</Fragment>
<main>
<div id="swagger-ui"></div>
</main>
</BaseLayout>
<script is:inline src="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.1.3/swagger-ui-bundle.js"></script>
<script type="module" is:inline>
window.onload = () => {
SwaggerUIBundle({
url: '/resources/openapi-spec.yml',
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIBundle.SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
]
});
}
</script>
<style lang="scss">
main {
padding: 0 2rem;
margin: 0 auto;
height: 100vh;
width: 100vw;
max-width: 1600px;
}
</style>