fit: Site preview
This commit is contained in:
parent
3c98d9e243
commit
d4d987944a
@ -37,13 +37,6 @@ def index():
|
||||
|
||||
@app.route('/<path:path>')
|
||||
def catch_all(path):
|
||||
# If file exists, load it
|
||||
if os.path.isfile('templates/' + path):
|
||||
return render_template(path)
|
||||
|
||||
# Try with .html
|
||||
if os.path.isfile('templates/' + path + '.html'):
|
||||
return render_template(path + '.html')
|
||||
return redirect('/') # 404 catch all
|
||||
|
||||
# 404 catch all
|
||||
|
@ -2,4 +2,7 @@ from flask import Flask, make_response, redirect, render_template_string, reques
|
||||
|
||||
|
||||
def render(data):
|
||||
if data == "":
|
||||
return "No data found for this domain"
|
||||
|
||||
return render_template_string(data)
|
Loading…
Reference in New Issue
Block a user