added deployment via docker compose

This commit is contained in:
2025-10-09 14:34:24 +01:00
parent 78f9e757dc
commit 24b3cbe4ce
13 changed files with 100 additions and 15 deletions
+5 -4
View File
@@ -165,7 +165,7 @@
function sendMessage() {
const message = input.value.trim();
if (message) {
fetch("http://localhost:8000/chat", {
fetch("/api/chat", {
method: "POST",
body: JSON.stringify({
user_id: user_id,
@@ -189,11 +189,11 @@
async function loadData() {
try {
const userIds = await fetch("http://localhost:8000/users/")
const userIds = await fetch("/api/users/")
.then(r => r.json());
const userPromises = userIds.map(userId =>
fetch(`http://localhost:8000/users/${userId}`)
fetch(`/api/users/${userId}`)
.then(r => r.text())
.then(username => ({ userId, username }))
);
@@ -206,7 +206,8 @@
console.log('Users loaded:', users);
const messageSource = new EventSource("http://localhost:8000/events");
const messageSource = new EventSource("/api/events");
messageSource.onopen = () => messagesContainer.innerHTML = '';
messageSource.onmessage = (event) => insertMessage(JSON.parse(event.data));
messageSource.onerror = (error) => {
console.error('EventSource error:', error);