Login and working api with simple chat

This commit is contained in:
2025-09-27 09:17:22 +02:00
parent 412eb3fe77
commit 24aefe7838
7 changed files with 194 additions and 99 deletions
-10
View File
@@ -1,10 +0,0 @@
import axios from "axios";
export async function auth(session_token: string, server_ip: string) {
const res = (await axios.post('http://localhost:3000/api/auth', {
server_ip,
session_token,
})).data;
return (res as any).token;
}
-16
View File
@@ -1,16 +0,0 @@
import axios from "axios";
export async function getUser() {
console.log((await axios.delete("http://localhost:3000/api/user", {
data: { username: "leo" },
})).data);
return ((await axios.post('http://localhost:3000/api/user', {
username: 'leo',
name: 'Leo',
email: '',
password: 'Idk123',
})).data).token;
}
// await getUser();