imseldrith commited on
Commit
4846855
·
1 Parent(s): c243a36

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -85,9 +85,10 @@ 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.route('/api-docs')
89
- def api_docs():
90
- return render_template('api_docs.html')
 
91
 
92
  if __name__ == "__main__":
93
  app.run(host="0.0.0.0", port=7860,debug=True)
 
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)