Spaces:
Running
Running
change get to post
Browse files
main.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from fastapi import FastAPI
|
| 2 |
from panel.io.fastapi import add_applications
|
| 3 |
from page import page
|
| 4 |
import logging
|
|
@@ -7,15 +7,15 @@ app = FastAPI()
|
|
| 7 |
add_applications(page, app=app)
|
| 8 |
|
| 9 |
|
| 10 |
-
@app.
|
| 11 |
-
async def log_app(message: str):
|
| 12 |
logger = logging.getLogger("APP")
|
| 13 |
logger.debug(message)
|
| 14 |
return {"details": "Logged Successfully. Please check the root page."}
|
| 15 |
|
| 16 |
|
| 17 |
-
@app.
|
| 18 |
-
async def log_game(message: str):
|
| 19 |
logger = logging.getLogger("Game")
|
| 20 |
logger.debug(message)
|
| 21 |
return {"details": "Logged Successfully. Please check the root page."}
|
|
|
|
| 1 |
+
from fastapi import FastAPI, Body
|
| 2 |
from panel.io.fastapi import add_applications
|
| 3 |
from page import page
|
| 4 |
import logging
|
|
|
|
| 7 |
add_applications(page, app=app)
|
| 8 |
|
| 9 |
|
| 10 |
+
@app.post("/app")
|
| 11 |
+
async def log_app(message: str = Body(...)):
|
| 12 |
logger = logging.getLogger("APP")
|
| 13 |
logger.debug(message)
|
| 14 |
return {"details": "Logged Successfully. Please check the root page."}
|
| 15 |
|
| 16 |
|
| 17 |
+
@app.post("/game")
|
| 18 |
+
async def log_game(message: str = Body(...)):
|
| 19 |
logger = logging.getLogger("Game")
|
| 20 |
logger.debug(message)
|
| 21 |
return {"details": "Logged Successfully. Please check the root page."}
|