mirror of
https://github.com/aquatix/alfagok.git
synced 2025-12-07 01:35:11 +01:00
Tell what game we are on
This commit is contained in:
@@ -59,6 +59,12 @@ def read_root():
|
|||||||
return {"Hello": "World"}
|
return {"Hello": "World"}
|
||||||
|
|
||||||
|
|
||||||
|
@app.get('/api/game')
|
||||||
|
def what_game():
|
||||||
|
"""Handle incoming guess."""
|
||||||
|
return {'game': get_game_id()}
|
||||||
|
|
||||||
|
|
||||||
@app.get('/api/guess')
|
@app.get('/api/guess')
|
||||||
def handle_guess(word: Union[str, None] = None):
|
def handle_guess(word: Union[str, None] = None):
|
||||||
"""Handle incoming guess."""
|
"""Handle incoming guess."""
|
||||||
@@ -78,7 +84,7 @@ def handle_guess(word: Union[str, None] = None):
|
|||||||
logger.info('Guess: %s for game %d (%s), goal is %s', word, current_game_id, word_of_the_day, hint)
|
logger.info('Guess: %s for game %d (%s), goal is %s', word, current_game_id, word_of_the_day, hint)
|
||||||
|
|
||||||
# before, after, it
|
# before, after, it
|
||||||
return {'hint': hint}
|
return {'game': current_game_id, 'hint': hint}
|
||||||
|
|
||||||
|
|
||||||
@app.get("/api/answer/{item_id}")
|
@app.get("/api/answer/{item_id}")
|
||||||
|
|||||||
Reference in New Issue
Block a user