Add xml endpoint

This commit is contained in:
John Sheehan
2014-03-12 14:53:46 -07:00
committed by Kevin McCarthy
parent b2cb8678f3
commit 64d10cba0e
2 changed files with 31 additions and 1 deletions
+7 -1
View File
@@ -45,7 +45,6 @@ tmpl_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'templates')
app = Flask(__name__, template_folder=tmpl_dir)
# -----------
# Middlewares
# -----------
@@ -535,5 +534,12 @@ def image():
return status_code(404)
@app.route("/xml")
def xml():
response = make_response(render_template("sample.xml"))
response.headers["Content-Type"] = "application/xml"
return response
if __name__ == '__main__':
app.run()