wip
This commit is contained in:
parent
892a3c9a8a
commit
3f28a10b16
5 changed files with 98 additions and 111 deletions
|
|
@ -1,25 +1,38 @@
|
|||
from fastapi import FastAPI
|
||||
from fastapi.responses import HTMLResponse
|
||||
|
||||
from learn_sql_model.api.hero import hero_router
|
||||
from learn_sql_model.api.user import user_router
|
||||
from learn_sql_model.api.websocket import web_socket_router
|
||||
|
||||
# from fastapi_socketio import SocketManager
|
||||
|
||||
|
||||
app = FastAPI()
|
||||
# socket_manager = SocketManager(app=app)
|
||||
|
||||
app.include_router(hero_router)
|
||||
app.include_router(user_router)
|
||||
app.include_router(web_socket_router)
|
||||
|
||||
|
||||
# @app.sio.on("join")
|
||||
# def handle_join(sid, *args, **kwargs):
|
||||
# app.sio.emit("lobby", "User joined")
|
||||
html = """
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Learn SQL Model</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Learn SQL Model</h1>
|
||||
<p>Join the game with the following command.
|
||||
</p>
|
||||
<p>
|
||||
pipx run --spec git+https://github.com/WaylonWalker/learn-sql-model lsm game run
|
||||
</p>
|
||||
<p>
|
||||
You can watch player data at <a href='/watch'>watch</a>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
"""
|
||||
|
||||
|
||||
# @app.sio.on("leave")
|
||||
# def handle_leave(sid, *args, **kwargs):
|
||||
# sm.emit("lobby", "User left")
|
||||
@app.get("/")
|
||||
async def get():
|
||||
return HTMLResponse(html)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue