This commit is contained in:
Andras Bacsai 2022-11-02 09:58:14 +01:00
parent eb92d39d40
commit 3a8929b9d7
2 changed files with 2 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,11 +1,9 @@
import { dev } from '$app/env'; import { dev } from '$app/env';
import cuid from 'cuid'; import cuid from 'cuid';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import { getAPIUrl } from '$lib/api';
import { getDomain } from '$lib/common'
import { writable, readable, type Writable } from 'svelte/store'; import { writable, readable, type Writable } from 'svelte/store';
import { io as ioClient } from 'socket.io-client'; import { io as ioClient } from 'socket.io-client';
const socket = ioClient(getAPIUrl(), { auth: { token: Cookies.get('token') }, autoConnect: false }); const socket = ioClient(dev ? 'http://localhost:3001' : '/', { auth: { token: Cookies.get('token') }, autoConnect: false });
export const io = socket; export const io = socket;
interface AppSession { interface AppSession {