Refactors event socket

This commit is contained in:
Rune Harlyk
2024-11-07 16:58:19 +01:00
committed by Rune Harlyk
parent fd652bd967
commit 89611b5e3e
20 changed files with 98 additions and 127 deletions
+1 -1
View File
@@ -27,7 +27,7 @@
onMount(async () => {
const ws = $location ? $location : window.location.host;
socket.init(`ws://${ws}/ws/events`);
socket.init(`ws://${ws}/api/ws/events`);
addEventListeners();
+1 -1
View File
@@ -7,7 +7,7 @@
const update = () => {
const ws = $location ? $location : window.location.host;
socket.init(`ws://${ws}/ws/events`);
socket.init(`ws://${ws}/api/ws/events`);
};
</script>
+20 -25
View File
@@ -5,29 +5,24 @@ import viteLittleFS from './vite-plugin-littlefs';
import EnvCaster from '@niku/vite-env-caster';
export default defineConfig({
plugins: [
sveltekit(),
Icons({
compiler: 'svelte'
}),
viteLittleFS(),
EnvCaster()
],
test: {
include: ['src/**/*.{test,spec}.{js,ts}']
},
server: {
proxy: {
'/api': {
target: 'http://spot-micro.local/',
changeOrigin: true,
ws: true
},
'/ws': {
target: 'ws://spot-micro.local/',
changeOrigin: true,
ws: true
}
}
}
plugins: [
sveltekit(),
Icons({
compiler: 'svelte'
}),
viteLittleFS(),
EnvCaster()
],
test: {
include: ['src/**/*.{test,spec}.{js,ts}']
},
server: {
proxy: {
'/api': {
target: 'http://spot-micro.local/',
changeOrigin: true,
ws: true
}
}
}
});