readme update

This commit is contained in:
JasterV 2020-11-15 18:13:01 +01:00
parent a97aa00db8
commit 5220e7a7f0
2 changed files with 4 additions and 2 deletions

View file

@ -8,6 +8,8 @@
> A web app that allows you to create or join rooms to chat with your friends anonymously:) > A web app that allows you to create or join rooms to chat with your friends anonymously:)
Rooms close their connection after 10 minutes. There can't be more than 10 rooms at a time (Just for memory safety reasons). This can be configured on the RoomsMap implementation. Have fun! :)
## Global dependencies ## Global dependencies
+ [node](https://nodejs.dev/) + [node](https://nodejs.dev/)

View file

@ -2,12 +2,12 @@ const ROOMS_API = "http://localhost:8000";
export async function createRoom() { export async function createRoom() {
let response = await fetch(ROOMS_API + '/rooms?create'); let response = await fetch(ROOMS_API + '/rooms?create');
if (!response.ok) throw new Error(response.statusText); if (!response.ok) throw new Error(await response.text());
return response.json(); return response.json();
} }
export async function fetchRoomInfo(id) { export async function fetchRoomInfo(id) {
let response = await fetch(ROOMS_API + '/rooms/' + id); let response = await fetch(ROOMS_API + '/rooms/' + id);
if (!response.ok) throw new Error(response.statusText); if (!response.ok) throw new Error(await response.text());
return response.json(); return response.json();
} }