added frontend scaffholding
This commit is contained in:
27
web/App.svelte
Normal file
27
web/App.svelte
Normal 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
1
web/global.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/// <reference types="svelte" />
|
||||
7
web/main.ts
Normal file
7
web/main.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import App from "./App.svelte";
|
||||
|
||||
const app = new App({
|
||||
target: document.body,
|
||||
});
|
||||
|
||||
export default app;
|
||||
Reference in New Issue
Block a user