dhruv575 commited on
Commit
e681062
·
1 Parent(s): ada5d3f

CORS Configured

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -49,8 +49,13 @@ if 'OPENAI_API_KEY' in os.environ:
49
  import openai
50
  openai.api_key = os.environ.get('OPENAI_API_KEY')
51
 
52
- # Enable CORS
53
- CORS(app)
 
 
 
 
 
54
 
55
  # Register blueprints
56
  app.register_blueprint(auth_bp, url_prefix='/api/auth')
 
49
  import openai
50
  openai.api_key = os.environ.get('OPENAI_API_KEY')
51
 
52
+ # Enable CORS with specific origins
53
+ origins = [
54
+ "http://localhost:3000", # Development frontend
55
+ "https://www.tryenflow.com" # Production frontend
56
+ ]
57
+
58
+ CORS(app, resources={r"/api/*": {"origins": origins}}, supports_credentials=True)
59
 
60
  # Register blueprints
61
  app.register_blueprint(auth_bp, url_prefix='/api/auth')