get path from event.pathParameters.proxy and fall back to event.path#17
Merged
vincentsarago merged 3 commits intomasterfrom Aug 1, 2019
Merged
get path from event.pathParameters.proxy and fall back to event.path#17vincentsarago merged 3 commits intomasterfrom
vincentsarago merged 3 commits intomasterfrom
Conversation
Owner
Author
|
deployed this code """app.py"""
from lambda_proxy.proxy import API
api = API(name="api", debug=True)
# This route won't work when using path mapping
@api.route("/", methods=["GET"], cors=True)
# This route will work only if the path mapping is set to /api
@api.route("/api", methods=["GET"], cors=True)
def index():
html = """<!DOCTYPE html>
<html>
<header><title>This is title</title></header>
<body>
Hello world
</body>
</html>"""
return ("OK", "text/html", html)
@api.route("/yo", methods=["GET"], cors=True)
def yo():
return ("OK", "text/plain", "YOOOOO")
@api.route("/hey", methods=["GET"], cors=True)
def hey():
return ("OK", "text/plain", "HEYYYYY")
service: demo
provider:
name: aws
runtime: python3.6
stage: ${opt:stage, 'production'}
region: eu-central-1
package:
artifact: package.zip
functions:
api:
handler: app.api
memorySize: 128
timeout: 3
events:
- http:
path: /{something+}
method: any
cors: true
# This is to support `/` root route,
# but won't work when using custom domain
- http:
path: /
method: get
cors: true
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
DanSchoppe
reviewed
Jul 31, 2019
Owner
Author
|
@DanSchoppe this is ready, if you can test from this branch it would be great |
DanSchoppe
approved these changes
Aug 1, 2019
DanSchoppe
left a comment
There was a problem hiding this comment.
@DanSchoppe this is ready, if you can test from this branch it would be great
Wow! Thank you for putting all this effort in!
I deployed a new tiler with custom base mapping and confirmed it fixed my original issue 🎉 💯. I also tested the endpoint without a base path mapping and confirmed it works perfectly as well 😄
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #16
To Do