fix: local dev api/ws urls

This commit is contained in:
Andras Bacsai committed 2022-11-16 12:40:28 +00:00
1 parent f54c0b7dff
commit 9b9b6937f4
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -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) {
+1 -1
View File
@@ -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 {