added deployment via docker compose
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user