Replace http(s) by ws for websockets

This commit is contained in:
Lilian 2023-02-28 10:54:03 +01:00 committed by Kilton937342
parent 7de2f33b30
commit 3d2ddbd695
2 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ export const registerRequest = (data: {
export const refreshRequest = (token: string) => {
return axios
.request({
url: `${env.PUBLIC_API_BASE}/refresh`,
url: `${env.PUBLIC_API_BASE}refresh`,
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',

View File

@ -27,7 +27,7 @@
const room = writable<Room | null>(null);
const member = writable<Member | null>(null);
const parcours = writable<ParcoursRead | null>(null);
const ws = connect(`${env.PUBLIC_API_BASE}api/ws/room/${$page.params.slug}`);
const ws = connect(`${env.PUBLIC_API_BASE.replace("https", "ws").replace('http', "ws")}ws/room/${$page.params.slug}`);
setContext("room", room);
setContext("member", member);