mirror of
https://codeberg.org/JasterV/chat_rooms.rs.git
synced 2026-04-26 18:20:03 +00:00
readme update
This commit is contained in:
parent
a97aa00db8
commit
5220e7a7f0
2 changed files with 4 additions and 2 deletions
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
> 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
|
||||
|
||||
+ [node](https://nodejs.dev/)
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@ const ROOMS_API = "http://localhost:8000";
|
|||
|
||||
export async function createRoom() {
|
||||
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();
|
||||
}
|
||||
|
||||
export async function fetchRoomInfo(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();
|
||||
}
|
||||
Loading…
Reference in a new issue