From 1a9441639d48df1fa3b181bdcf7eb73e2acf7276 Mon Sep 17 00:00:00 2001 From: Shivam Gutgutia Date: Sun, 17 Dec 2023 20:06:49 +0530 Subject: [PATCH] Trying cors new origin --- app.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app.py b/app.py index d10c68e..f7e0b3d 100644 --- a/app.py +++ b/app.py @@ -7,20 +7,22 @@ load_dotenv() app= Flask(__name__) -CORS(app) -#CORS(app, resources={r"/*": {"origins": "https://contactify.codechefvit.com", "methods": ["GET", "POST"]}}) +#CORS(app) +CORS(app, resources={r"/*": {"origins": "https://www.google.com", "methods": ["GET", "POST"]}}) app.config['MAX_CONTENT_LENGTH'] = 1024*1024*1024 -@app.errorhandler(Exception) -def errorHandler(error): - response = jsonify({'error': 'Server Error', 'message': str(error)}) - response.status_code = 500 - app.logger.error('Server Error: %s', error) - app.logger.error(traceback.format_exc()) # Log the traceback - return response + app.register_blueprint(router) +# @app.errorhandler(Exception) +# def errorHandler(error): +# response = jsonify({'error': 'Server Error', 'message': str(error)}) +# response.status_code = 500 +# app.logger.error('Server Error: %s', error) +# app.logger.error(traceback.format_exc()) # Log the traceback +# return response + if __name__ == "__main__": app.run(host='0.0.0.0',port=os.getenv("PORT",5000))