File tree Expand file tree Collapse file tree 2 files changed +6
-39
lines changed Expand file tree Collapse file tree 2 files changed +6
-39
lines changed Original file line number Diff line number Diff line change 11option_settings:
22 aws:elasticbeanstalk:container:python:
3- WSGIPath: application:app
3+ WSGIPath: application:application
44 aws:elasticbeanstalk:application:environment:
5- ALLOWED_ORIGINS: "https://getgit789.github.io"
6- PORT: "5000"
7- aws:elasticbeanstalk:environment:process:default:
8- HealthCheckPath: /health
9- HealthCheckTimeout: 5
10- HealthyThresholdCount: 3
11- UnhealthyThresholdCount: 5
12- MatcherHTTPCode: 200
13- Port: 5000
14- Protocol: HTTP
5+ PORT: "8000"
156 aws:elasticbeanstalk:environment:proxy:
167 ProxyServer: nginx
17- aws:elasticbeanstalk:environment:
18- LoadBalancerType: application
19- ServiceRole: aws-elasticbeanstalk-service-role
20- aws:autoscaling:launchconfiguration:
21- IamInstanceProfile: aws-elasticbeanstalk-ec2-role
22- aws:elbv2:listener:default:
23- ListenerEnabled: true
24- Protocol: HTTP
25- DefaultProcess: default
26- aws:elasticbeanstalk:healthreporting:system:
27- SystemType: enhanced
Original file line number Diff line number Diff line change 11from fastapi import FastAPI
22from fastapi .middleware .cors import CORSMiddleware
3- from mangum import Mangum
43from backend .app .main import app
54
65# Update the application instance name to match the EB configuration
76application = app
87
9- # Add CORS middleware with specific origins
10- origins = [
11- "https://getgit789.github.io" ,
12- "https://getgit789.github.io/python-interpreter-online/" ,
13- "http://localhost:5000" ,
14- "http://127.0.0.1:5000"
15- ]
16-
8+ # Add CORS middleware
179application .add_middleware (
1810 CORSMiddleware ,
19- allow_origins = origins ,
11+ allow_origins = [ "*" ] ,
2012 allow_credentials = True ,
2113 allow_methods = ["*" ],
22- allow_headers = ["*" ],
23- expose_headers = ["*" ],
24- max_age = 3600
14+ allow_headers = ["*" ]
2515)
2616
27- # Create handler for AWS Lambda
28- handler = Mangum (application )
29-
3017if __name__ == "__main__" :
3118 import uvicorn
32- uvicorn .run (application , host = "0.0.0.0" , port = 80 )
19+ uvicorn .run (application , host = "0.0.0.0" , port = 8000 )
You can’t perform that action at this time.
0 commit comments