File tree Expand file tree Collapse file tree 4 files changed +23
-3
lines changed
Expand file tree Collapse file tree 4 files changed +23
-3
lines changed Original file line number Diff line number Diff line change 1+ from flask import Flask
2+ app = Flask (__name__ )
3+
4+
5+ @app .route ("/cats" )
6+ def cats ():
7+ return "Cats"
8+
9+ @app .route ("/dogs/<id>" )
10+ def dog (id ):
11+ return "Dog"
Original file line number Diff line number Diff line change 99 "author" : " " ,
1010 "license" : " ISC" ,
1111 "dependencies" : {
12- "serverless" : " ^2.33 .1" ,
12+ "serverless" : " ^2.64 .1" ,
1313 "serverless-python-requirements" : " ^5.1.1"
1414 }
1515}
Original file line number Diff line number Diff line change 1- pytest
1+ pytest
2+ Flask == 1.0.2
Original file line number Diff line number Diff line change 1- service : " " # <name> of the service
1+ service : " aws-lambda-python " # <name> of the service
22provider :
33 name : aws
44 runtime : python3.8
@@ -25,6 +25,11 @@ provider:
2525 # - '/*'
2626
2727functions :
28+ api :
29+ handler : wsgi_handler.handler
30+ events :
31+ - http : ANY /
32+ - http : ANY /{proxy+}
2833 handler :
2934 handler : handler.handler
3035 timeout : 300
@@ -34,10 +39,13 @@ functions:
3439
3540plugins :
3641 - serverless-python-requirements
42+ - serverless-wsgi
3743
3844custom :
3945 pythonRequirements :
4046 dockerizePip : true
47+ wsgi :
48+ app : api.app
4149
4250# resources:
4351# Resources:
You can’t perform that action at this time.
0 commit comments