fix: local dev api/ws urls
This commit is contained in:
parent
f54c0b7dff
commit
9b9b6937f4
@ -11,7 +11,7 @@ export function getAPIUrl() {
|
||||
return `https://${CODESANDBOX_HOST.replace(/\$PORT/, '3001')}`;
|
||||
}
|
||||
return dev
|
||||
? 'http://localhost:3001'
|
||||
? `http://${window.location.hostname}:3001`
|
||||
: 'http://localhost:3000';
|
||||
}
|
||||
export function getWebhookUrl(type: string) {
|
||||
|
@ -3,7 +3,7 @@ import cuid from 'cuid';
|
||||
import Cookies from 'js-cookie';
|
||||
import { writable, readable, type Writable } from 'svelte/store';
|
||||
import { io as ioClient } from 'socket.io-client';
|
||||
const socket = ioClient(dev ? 'http://localhost:3001' : '/', { auth: { token: Cookies.get('token') }, autoConnect: false });
|
||||
const socket = ioClient(dev ? `http://${window.location.hostname}:3001` : '/', { auth: { token: Cookies.get('token') }, autoConnect: false });
|
||||
|
||||
export const io = socket;
|
||||
interface AppSession {
|
||||
|
Loading…
x
Reference in New Issue
Block a user