Skip to content

Commit cf39a38

Browse files
committed
Use the http api gateway
1 parent 68a2376 commit cf39a38

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
app = Flask(__name__)
33

44

5-
@app.route("/cats")
5+
@app.route("/")
66
def cats():
7-
return "Cats"
7+
return "aws-lambda-python"
88

99
@app.route("/dogs/<id>")
1010
def dog(id):

serverless.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ provider:
66
region: us-west-2
77
deploymentBucket:
88
name: infra.opszero.com
9+
httpApi:
10+
cors: true
911
# iamRoleStatements:
1012
# - Effect: "Allow"
1113
# Action:
@@ -24,15 +26,12 @@ provider:
2426
# - "Ref" : "setupname"
2527
# - '/*'
2628

27-
28-
29-
3029
functions:
3130
api:
3231
handler: wsgi_handler.handler
3332
events:
34-
- http: ANY /
35-
- http: ANY /{proxy+}
33+
- httpApi:
34+
path: '*'
3635
# handler:
3736
# handler: handler.hello
3837
# timeout: 300

0 commit comments

Comments
 (0)