added frontend scaffholding

This commit is contained in:
2022-05-09 20:01:31 +02:00
parent d8e42671ef
commit d60830c70a
9 changed files with 2870 additions and 0 deletions

27
web/App.svelte Normal file
View File

@@ -0,0 +1,27 @@
<script lang="ts">
import { onMount } from "svelte";
const slug = window.location.pathname.split("/").pop();
let data: String = null
onMount(async () => {
const res = await fetch(`/s/${slug}`);
document.title = slug;
});
</script>
<main>
<div>{ slug }</div>
<div>
{#if data === null}
Loading data...
{:else}
{data}
{/if}
</div>
</main>
<style>
</style>

1
web/global.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
/// <reference types="svelte" />

7
web/main.ts Normal file
View File

@@ -0,0 +1,7 @@
import App from "./App.svelte";
const app = new App({
target: document.body,
});
export default app;