Added libs

This commit is contained in:
Lucas
2026-01-25 13:55:46 +10:00
parent 575c682afc
commit f70af3c4ea
229 changed files with 26983 additions and 0 deletions

43
rendezvous/vue/api/api.js Normal file
View File

@@ -0,0 +1,43 @@
const apiUrl = "/api/rendezvous";
export const rendezvousApi = {
async runServer(user){
const data = {"user": user};
const requestOptions = {
method: 'POST',
headers: {'Content-Type': 'application/json',},
body: JSON.stringify(data),
};
try {
const response = await fetch(apiUrl+"/server", requestOptions);
if (!response.ok) {
const errorText = await response.text();
throw new Error(`Error starting server: ${response.status} - ${errorText}`);
}
const result = await response.json();
return result;
} catch (error) {
console.error("Error starting server:", error);
throw error;
}
},
async getServerStatus(){
try {
const response = await fetch(apiUrl+"/server")
if (!response.ok) {
const errorText = await response.text();
throw new Error(`Error fetching users: ${response.status} - ${errorText}`);
}
const result = await response.json()
return result;
} catch (error) {
console.error("Error fetching configs:", error);
throw error;
}
},
}