New file: requirements.txt
Added requirements for git clone Edited file: backend.py Added first steps towards token system Finished Leaderboard getmain
parent
48755ddd69
commit
c234dbe088
11
backend.py
11
backend.py
|
@ -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)
|
|
@ -0,0 +1,3 @@
|
|||
sqlite3
|
||||
Flask
|
||||
flask_restful
|
Loading…
Reference in New Issue