more fixes

This commit is contained in:
jason
2026-03-12 10:36:02 -05:00
parent 1b8e0367f6
commit ff0730b6c6
3 changed files with 10 additions and 10 deletions

View File

@@ -29,17 +29,15 @@ def create_app(config_name=None):
db.create_all()
_run_migrations()
@app.route('/', defaults={'path': ''})
@app.route('/<path:path>')
def serve_react(path):
static_folder = app.static_folder
if path and os.path.exists(os.path.join(static_folder, path)):
return send_from_directory(static_folder, path)
return send_from_directory(static_folder, 'index.html')
@app.route('/')
def index():
return send_from_directory(app.static_folder, 'index.html')
@app.errorhandler(404)
def not_found(e):
return jsonify({'error': 'Resource not found', 'message': str(e)}), 404
def handle_404(e):
if request.path.startswith('/api/'):
return jsonify({'error': 'Resource not found', 'message': str(e)}), 404
return send_from_directory(app.static_folder, 'index.html')
@app.errorhandler(400)
def bad_request(e):