wip
This commit is contained in:
9
apps/client/src/app.d.ts
vendored
Normal file
9
apps/client/src/app.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
// See https://kit.svelte.dev/docs/types#app
|
||||
// for information about these interfaces
|
||||
// and what to do when importing types
|
||||
declare namespace App {
|
||||
// interface Locals {}
|
||||
// interface PageData {}
|
||||
// interface Error {}
|
||||
// interface Platform {}
|
||||
}
|
||||
12
apps/client/src/app.html
Normal file
12
apps/client/src/app.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
<body>
|
||||
<div class="h-screen">%sveltekit.body%</div>
|
||||
</body>
|
||||
</html>
|
||||
14
apps/client/src/app.postcss
Normal file
14
apps/client/src/app.postcss
Normal file
@@ -0,0 +1,14 @@
|
||||
/* Write your global styles here, in PostCSS syntax */
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
html {
|
||||
@apply bg-black text-white;
|
||||
}
|
||||
input {
|
||||
@apply bg-black border;
|
||||
}
|
||||
button {
|
||||
@apply border px-2 p-1 bg-green-500;
|
||||
}
|
||||
22
apps/client/src/lib/store.ts
Normal file
22
apps/client/src/lib/store.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { writable, readable, type Writable, type Readable } from 'svelte/store';
|
||||
import superjson from 'superjson';
|
||||
import type { AppRouter } from 'server/src/router';
|
||||
import { createTRPCProxyClient, httpBatchLink } from '@trpc/client';
|
||||
import { browser, dev } from '$app/environment';
|
||||
import Cookies from 'js-cookie';
|
||||
const serverBaseUrl = dev ? `http://${browser && window.location.hostname}:2022` : '';
|
||||
|
||||
export let token: string = Cookies.get('token') || '';
|
||||
export const t = createTRPCProxyClient<AppRouter>({
|
||||
transformer: superjson,
|
||||
links: [
|
||||
httpBatchLink({
|
||||
url: `${serverBaseUrl}/trpc`,
|
||||
headers() {
|
||||
return {
|
||||
Authorization: token
|
||||
};
|
||||
}
|
||||
})
|
||||
]
|
||||
});
|
||||
7
apps/client/src/routes/+layout.svelte
Normal file
7
apps/client/src/routes/+layout.svelte
Normal file
@@ -0,0 +1,7 @@
|
||||
<script lang="ts">
|
||||
import '../app.postcss';
|
||||
</script>
|
||||
|
||||
<div class="h-full">
|
||||
<slot />
|
||||
</div>
|
||||
10
apps/client/src/routes/+page.svelte
Normal file
10
apps/client/src/routes/+page.svelte
Normal file
@@ -0,0 +1,10 @@
|
||||
<script lang="ts">
|
||||
import { t } from '$lib/store';
|
||||
import { onMount } from 'svelte';
|
||||
onMount(async () => {
|
||||
const a = await t.api.getConnection.query();
|
||||
console.log(a);
|
||||
});
|
||||
</script>
|
||||
|
||||
<div>hello</div>
|
||||
Reference in New Issue
Block a user