mirror of
https://github.com/asimonson1125/asimonson1125.github.io.git
synced 2026-02-25 13:09:51 -06:00
freaky hotspots
This commit is contained in:
24
src/app.py
24
src/app.py
@@ -44,36 +44,12 @@ def funcGen(pagename, pages):
|
||||
for i in pages:
|
||||
func = funcGen(i, pages)
|
||||
app.add_url_rule(pages[i]['canonical'], i, func)
|
||||
|
||||
|
||||
# for i in pages:
|
||||
# exec(f"@app.route(pages['{i}']['canonical'])\ndef {i}(): return flask.render_template('header.html', var=pages['{i}'])")
|
||||
|
||||
|
||||
@app.route("/resume")
|
||||
@app.route("/Resume.pdf")
|
||||
def resume():
|
||||
return flask.send_file("./static/Resume.pdf")
|
||||
|
||||
@app.route("/hotspots")
|
||||
def hotspotsRIT():
|
||||
url = HotspotsURL
|
||||
if flask.request.args.get("legend") == "false":
|
||||
url += "?legend=false"
|
||||
pagevars = {
|
||||
"template": "iframe.html",
|
||||
"title": f"Hotspots @ RIT",
|
||||
"description": "Hotspots @ RIT by Andrew Simonson",
|
||||
"canonical": "/hotspots",
|
||||
}
|
||||
return flask.render_template("iframe.html", url=url, var=pagevars)
|
||||
|
||||
@app.route("/hotspots/<path>")
|
||||
def hotspotsProxy(path):
|
||||
resp = flask.make_response(requests.get(f"{HotspotsURL}/{path}").content)
|
||||
resp.headers['Access-Control-Allow-Origin'] = '*' # or restrict to your site's domain
|
||||
return resp
|
||||
|
||||
@app.errorhandler(Exception)
|
||||
def page404(e):
|
||||
eCode = e.code
|
||||
|
||||
Reference in New Issue
Block a user