Add debug statements
This commit is contained in:
parent
99da9da68a
commit
27f8b6d5d0
|
@ -24,6 +24,8 @@ def startup():
|
||||||
finally:
|
finally:
|
||||||
fd.close()
|
fd.close()
|
||||||
|
|
||||||
|
print("Read", len(data), "quizzes from DB")
|
||||||
|
|
||||||
|
|
||||||
@app.route('/db/<id>', methods = ['GET'])
|
@app.route('/db/<id>', methods = ['GET'])
|
||||||
def get(id):
|
def get(id):
|
||||||
|
@ -47,6 +49,8 @@ def post():
|
||||||
id = generateNewKey()
|
id = generateNewKey()
|
||||||
data[id] = request.data.decode('UTF-8')
|
data[id] = request.data.decode('UTF-8')
|
||||||
|
|
||||||
|
print("Received new quiz. ID:", id)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
fd = open(filename, 'w+')
|
fd = open(filename, 'w+')
|
||||||
json.dump(data, fd, indent=2)
|
json.dump(data, fd, indent=2)
|
||||||
|
|
Loading…
Reference in New Issue