Spaces:
Running
Running
imseldrith
commited on
Commit
·
a6e68e4
1
Parent(s):
4846855
Update app.py
Browse files
app.py
CHANGED
@@ -85,11 +85,16 @@ def api_generate_image():
|
|
85 |
return jsonify({'error': f"An error occurred while writing the image to file: {e}"}), 500
|
86 |
|
87 |
return send_file(image_path, mimetype='image/jpeg', as_attachment=True)
|
|
|
88 |
@app.errorhandler(404)
|
89 |
def page_not_found(e):
|
90 |
# Render the 404.html template
|
91 |
return render_template('404.html'), 404
|
92 |
-
|
|
|
|
|
|
|
|
|
93 |
if __name__ == "__main__":
|
94 |
app.run(host="0.0.0.0", port=7860,debug=True)
|
95 |
|
|
|
85 |
return jsonify({'error': f"An error occurred while writing the image to file: {e}"}), 500
|
86 |
|
87 |
return send_file(image_path, mimetype='image/jpeg', as_attachment=True)
|
88 |
+
|
89 |
@app.errorhandler(404)
|
90 |
def page_not_found(e):
|
91 |
# Render the 404.html template
|
92 |
return render_template('404.html'), 404
|
93 |
+
|
94 |
+
@app.route('/api-docs')
|
95 |
+
def api_docs():
|
96 |
+
return render_template('api_docs.html')
|
97 |
+
|
98 |
if __name__ == "__main__":
|
99 |
app.run(host="0.0.0.0", port=7860,debug=True)
|
100 |
|