Skip to content

Commit

Permalink
zadnji commit
Browse files Browse the repository at this point in the history
  • Loading branch information
voloder committed Jan 29, 2024
1 parent 5644b48 commit 9f9e0b6
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# POKRETANJE BACKENDA

Prvo, na server instalirajte Python 3.11.6

Instalirajte biblioteke potrebne za rad komandom `pip install -r requirements.txt`

Kada pip instalira biblioteke, komandom `uvicorn main:app --host=0.0.0.0` započnite server.

Možete podesiti host IP kako god hoćete, 0.0.0.0 se koristi da bi server bio vidljiv sa drugih uređaja

Ako je sve urađeno kako treba, u konzoli će se prikazati
`INFO: Uvicorn running on http://0.0.0.0:8000`

Web fajlovi ce se automatski servirati na tom URL-u

Što se tiče aplikacije, u fajlu `lib/backend.dart`, na liniji 17 promijeniti `host` varijablu

# Naš environment

Mi koristimo Ubuntu 20.04 VPS koji iznajmljujemo od Globalhost-a i ima domenu xudev.io. Na njemu hostujemo ovaj kod

3 changes: 1 addition & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import asyncio
import json
from fastapi import FastAPI, HTTPException, WebSocket
from fastapi.staticfiles import StaticFiles
from fastapi import FastAPI, HTTPException
import socketio

from models import *
Expand Down
2 changes: 1 addition & 1 deletion models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List, Optional
from typing import List
from pydantic import BaseModel

class Igrac(BaseModel):
Expand Down
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
uvicorn==0.24.0.post1
python-socketio==5.11.0
pydantic==2.5.2
fastapi==0.104.1

0 comments on commit 9f9e0b6

Please sign in to comment.