Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
API_AUTH_URL=http://localhost:8000
API_CHAT_URL=http://localhost:8002
LOG_DB_URL=
LOG_DATABASE_NAME=ws-server-logs
LOG_LEVEL=DEBUG
WS_HOST=0.0.0.0
WS_PORT=8006
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*.pem

#Environment
.env
#.env
.venv
env/
venv/
Expand Down
1 change: 0 additions & 1 deletion src/mongodb_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from pymongo.server_api import ServerApi
from pymongo.asynchronous.database import AsyncDatabase
from pymongo.database import Database
import uuid

class MongoAsyncService:

Expand Down
8 changes: 4 additions & 4 deletions src/user_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def verify_token(token: str):
result = False
email = None
try:
url = os.environ["API_URL"] + "/auth/validate-token"
url = os.environ["API_AUTH_URL"] + "/auth/validate-token"
headers = {"Authorization": "Bearer " + token}

response = requests.post(url, headers= headers)
Expand All @@ -27,7 +27,7 @@ def verify_token(token: str):
def save_message(message: Message, token: str):
result = False
try:
url = os.environ["API_URL"] + "/chat/save-message"
url = os.environ["API_CHAT_URL"] + "/chat/save-message"
headers = {
"Authorization": "Bearer " + token,
"Content-Type": "application/json"
Expand All @@ -46,7 +46,7 @@ def save_message(message: Message, token: str):
def get_messages(user: str, token: str) -> list[Message] | None:
result = None
try:
url = os.environ["API_URL"] + "/chat/get-messages"
url = os.environ["API_CHAT_URL"] + "/chat/get-messages"
headers = {"Authorization": "Bearer " + token}

response = requests.get(url, headers= headers)
Expand All @@ -61,7 +61,7 @@ def get_messages(user: str, token: str) -> list[Message] | None:
def update_status(token: str, status: bool):
result = False
try:
url = str(f"{ os.environ["API_URL"] }/chat/change-status/?user_status={ status }")
url = str(f"{ os.environ["API_AUTH_URL"] }/user/change-status/?user_status={ status }")
headers = {"Authorization": "Bearer " + token}

response = requests.post(url, headers = headers)
Expand Down