add tag "home"
Browse files
main.py
CHANGED
|
@@ -5,11 +5,13 @@ import game_util
|
|
| 5 |
app = FastAPI()
|
| 6 |
|
| 7 |
|
| 8 |
-
@app.get("/")
|
| 9 |
def root():
|
| 10 |
return {"message": "hi!"}
|
| 11 |
|
|
|
|
| 12 |
GAME = "sname"
|
|
|
|
| 13 |
@app.post(f"/games/{GAME}/nlp/c", tags=[GAME])
|
| 14 |
def main_snake(code: str=Body(), command: str=Body()):
|
| 15 |
return game_util.create(GAME, code, command)
|
|
@@ -29,7 +31,9 @@ def main_snake(code: str=Body(), command: str=Body()):
|
|
| 29 |
def main_snake(code: str=Body(), command: str=Body()):
|
| 30 |
return game_util.delete(GAME, code, command)
|
| 31 |
|
|
|
|
| 32 |
GAME = "angrybird"
|
|
|
|
| 33 |
@app.post(f"/games/{GAME}/nlp/c", tags=[GAME])
|
| 34 |
def main_snake(code: str=Body(), command: str=Body()):
|
| 35 |
return game_util.create(GAME, code, command)
|
|
|
|
| 5 |
app = FastAPI()
|
| 6 |
|
| 7 |
|
| 8 |
+
@app.get("/", tags=["home"])
|
| 9 |
def root():
|
| 10 |
return {"message": "hi!"}
|
| 11 |
|
| 12 |
+
##############################
|
| 13 |
GAME = "sname"
|
| 14 |
+
##############################
|
| 15 |
@app.post(f"/games/{GAME}/nlp/c", tags=[GAME])
|
| 16 |
def main_snake(code: str=Body(), command: str=Body()):
|
| 17 |
return game_util.create(GAME, code, command)
|
|
|
|
| 31 |
def main_snake(code: str=Body(), command: str=Body()):
|
| 32 |
return game_util.delete(GAME, code, command)
|
| 33 |
|
| 34 |
+
##############################
|
| 35 |
GAME = "angrybird"
|
| 36 |
+
##############################
|
| 37 |
@app.post(f"/games/{GAME}/nlp/c", tags=[GAME])
|
| 38 |
def main_snake(code: str=Body(), command: str=Body()):
|
| 39 |
return game_util.create(GAME, code, command)
|