mirror of
https://github.com/Lissy93/web-check.git
synced 2025-06-19 03:16:45 +02:00
Adds API docs route
This commit is contained in:
parent
891982321c
commit
d2f58f40b5
2856
public/resources/openapi-spec.yml
Normal file
2856
public/resources/openapi-spec.yml
Normal file
File diff suppressed because it is too large
Load Diff
42
src/pages/docs-api.astro
Normal file
42
src/pages/docs-api.astro
Normal 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>
|
Loading…
x
Reference in New Issue
Block a user