Commit dca3b58e authored by Emanuele Santoro's avatar Emanuele Santoro

Better debugging information

parent b073e7cd
......@@ -7,6 +7,7 @@ musho = Flask(__name__)
links = dict()
page_cache = dict()
musho_url = "http://localhost:9000"
debug = None
def page(path) :
if path not in page_cache :
......@@ -32,10 +33,16 @@ def saveLink() :
@musho.route("/l/<string:link_id>")
def resolveLink(link_id):
if debug:
print("Risolvo il link '%s'" % link_id)
if link_id in links :
url = links[link_id]
return redirect(url)
else :
if debug:
print("Link non trovato")
print("contenuto del db:")
print(links)
return redirect("/")
debug = os.getenv("DEBUG", None)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment