New file: requirements.txt

Added requirements for git clone

Edited file: backend.py

Added first steps towards token system
Finished Leaderboard get
main
Anorak_1 2022-10-30 19:47:39 +01:00
parent 48755ddd69
commit c234dbe088
2 changed files with 11 additions and 3 deletions

View File

@ -1,4 +1,4 @@
from flask import Flask
from flask import Flask, request
from flask_restful import Resource, Api
import sqlite3
@ -14,9 +14,14 @@ class LeaderAPI(Resource):
db.close()
dbcon.close()
# dictionary of leaderboard is json, encoding using json.dumps results in double encoding with "" and return to browser as type string
return dict(leaderboard)
return list(leaderboard)
class TokenAPI(Resource):
def get(self):
print(request.remote_addr)
api.add_resource(LeaderAPI, "/")
api.add_resource(TokenAPI, "/token/")
if __name__ == "__main__":
app.run()
app.run(host="0.0.0.0", port=25540)

3
requirements.txt 100644
View File

@ -0,0 +1,3 @@
sqlite3
Flask
flask_restful