Add joining by ID
This commit is contained in:
10
app.py
10
app.py
@@ -189,9 +189,17 @@ class Room:
|
|||||||
rooms: dict[str, Room] = {}
|
rooms: dict[str, Room] = {}
|
||||||
|
|
||||||
|
|
||||||
|
API_ROOT = "http://127.0.0.1:8080"
|
||||||
|
|
||||||
|
|
||||||
@app.GET("/")
|
@app.GET("/")
|
||||||
async def home(request):
|
async def home(request):
|
||||||
return render("index.html", {"API_ROOT": "http://127.0.0.1:8080"})
|
return render("index.html", {"API_ROOT": API_ROOT})
|
||||||
|
|
||||||
|
|
||||||
|
@app.GET("/<id>")
|
||||||
|
async def home_with_id(request, id):
|
||||||
|
return render("index.html", {"API_ROOT": API_ROOT})
|
||||||
|
|
||||||
|
|
||||||
@app.POST("/join/<room_id>")
|
@app.POST("/join/<room_id>")
|
||||||
|
|||||||
Reference in New Issue
Block a user