add server settings

This commit is contained in:
Aubrey 2024-12-21 23:59:28 -06:00
parent 30fe1ae80b
commit f610da3d9d
No known key found for this signature in database
5 changed files with 31 additions and 40 deletions

View file

@ -1,38 +1,4 @@
# sv
pnpm i
pnpm run build
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
## Creating a project
If you're seeing this, you've probably already done this step. Congrats!
```bash
# create a new project in the current directory
npx sv create
# create a new project in my-app
npx sv create my-app
```
## Developing
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
```bash
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
```
## Building
To create a production version of your app:
```bash
npm run build
```
You can preview the production build with `npm run preview`.
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
place result from `build/` in a web server and in the directory place a settings.json as well

View file

@ -11,6 +11,7 @@
},
"devDependencies": {
"@sveltejs/adapter-node": "^5.2.0",
"@sveltejs/adapter-static": "^3.0.8",
"@sveltejs/kit": "^2.9.0",
"@sveltejs/vite-plugin-svelte": "^5.0.0",
"@vitejs/plugin-basic-ssl": "^1.2.0",

View file

@ -15,6 +15,9 @@ importers:
'@sveltejs/adapter-node':
specifier: ^5.2.0
version: 5.2.10(@sveltejs/kit@2.9.1(@sveltejs/vite-plugin-svelte@5.0.1(svelte@5.10.0)(vite@6.0.3))(svelte@5.10.0)(vite@6.0.3))
'@sveltejs/adapter-static':
specifier: ^3.0.8
version: 3.0.8(@sveltejs/kit@2.9.1(@sveltejs/vite-plugin-svelte@5.0.1(svelte@5.10.0)(vite@6.0.3))(svelte@5.10.0)(vite@6.0.3))
'@sveltejs/kit':
specifier: ^2.9.0
version: 2.9.1(@sveltejs/vite-plugin-svelte@5.0.1(svelte@5.10.0)(vite@6.0.3))(svelte@5.10.0)(vite@6.0.3)
@ -344,6 +347,11 @@ packages:
peerDependencies:
'@sveltejs/kit': ^2.4.0
'@sveltejs/adapter-static@3.0.8':
resolution: {integrity: sha512-YaDrquRpZwfcXbnlDsSrBQNCChVOT9MGuSg+dMAyfsAa1SmiAhrA5jUYUiIMC59G92kIbY/AaQOWcBdq+lh+zg==}
peerDependencies:
'@sveltejs/kit': ^2.0.0
'@sveltejs/kit@2.9.1':
resolution: {integrity: sha512-D+yH3DTvvkjXdl3Xv7akKmolrArDZRtsFv3nlxJPjlIKsZEpkkInnomKJuAql2TrNGJ2dJMGBO1YYgVn2ILmag==}
engines: {node: '>=18.13'}
@ -834,6 +842,10 @@ snapshots:
'@sveltejs/kit': 2.9.1(@sveltejs/vite-plugin-svelte@5.0.1(svelte@5.10.0)(vite@6.0.3))(svelte@5.10.0)(vite@6.0.3)
rollup: 4.28.1
'@sveltejs/adapter-static@3.0.8(@sveltejs/kit@2.9.1(@sveltejs/vite-plugin-svelte@5.0.1(svelte@5.10.0)(vite@6.0.3))(svelte@5.10.0)(vite@6.0.3))':
dependencies:
'@sveltejs/kit': 2.9.1(@sveltejs/vite-plugin-svelte@5.0.1(svelte@5.10.0)(vite@6.0.3))(svelte@5.10.0)(vite@6.0.3)
'@sveltejs/kit@2.9.1(@sveltejs/vite-plugin-svelte@5.0.1(svelte@5.10.0)(vite@6.0.3))(svelte@5.10.0)(vite@6.0.3)':
dependencies:
'@sveltejs/vite-plugin-svelte': 5.0.1(svelte@5.10.0)(vite@6.0.3)

View file

@ -8,10 +8,12 @@ import { type WriteEvent, writeEvent, WriteKind } from "./protocol/clientEvent";
import { BinaryWriter } from "./binary/writer";
import { cached, type CachedWritable, type Cached, cachedWritable } from "./stores";
import { BinaryReader } from "./binary/reader";
import { base } from "$app/paths";
export class Client {
static async connect(name: Readable<string>, audioManager: AudioManager, outputAudio: HTMLDivElement) {
const transport = new WebTransport(`https://${location.hostname}:4433`, { allowPooling: false });
const settings = await (await fetch("settings.json")).json();
const transport = new WebTransport(`https://${settings.host}:${settings.port}`, { allowPooling: false });
await transport.ready;
console.log("ready!");
const stream = await transport.createBidirectionalStream();

View file

@ -1,4 +1,5 @@
import adapter from '@sveltejs/adapter-node';
// import adapter from '@sveltejs/adapter-node';
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
/** @type {import('@sveltejs/kit').Config} */
@ -11,7 +12,16 @@ const config = {
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
adapter: adapter()
// adapter: adapter()
adapter: adapter({
// default options are shown. On some platforms
// these options are set automatically — see below
pages: 'build',
assets: 'build',
fallback: undefined,
precompress: false,
strict: true
})
}
};