22 lines
No EOL
543 B
Python
22 lines
No EOL
543 B
Python
from typing import *
|
|
import flask
|
|
import db
|
|
|
|
class Endpoints:
|
|
#db: db.DB
|
|
|
|
def __init__(self, app: flask.Flask):
|
|
app.add_url_rule("/hello", view_func=self.hello, methods=["GET"])
|
|
app.add_url_rule("/getHash", view_func=self.getHash, methods=["GET"])
|
|
|
|
|
|
def hello(self):
|
|
return "Hello world!"
|
|
|
|
#test
|
|
'''def getHash(self):
|
|
return db.r.hget("tiploc:BHAMNWS", "description")'''
|
|
|
|
def getHash(self):
|
|
tiploc = "BHAMNWS"
|
|
return flask.jsonify(db.DB.getHash(self, tiploc)) |