change API gateway path param to 'proxy'

This commit is contained in:
Brandon Liu
2022-07-22 00:33:37 +08:00
parent e173ca76f6
commit 02ac315df6
2 changed files with 3 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ Configure these Lambda environment variables:
* Example path setting for objects in a directory: `my_folder/{name}/file.pmtiles`
* `TILE_PATH`: optional, define the URL route of the tiles API. Default `/{name}/{z}/{x}/{y}.pbf`
For API Gateway integration, your Lambda Proxy Integration route will need to specify a greedy capturing parameter called `tile_path` e.g. `/tiles/{tile_path+}`
For API Gateway integration, your Lambda Proxy Integration route will need to specify a greedy capturing parameter called `proxy` e.g. `/{proxy+}` (the default)
## Test Event

View File

@@ -37,8 +37,8 @@ def lambda_handler(event, context):
path = None
if event.get("pathParameters"):
# API Gateway (HTTP or REST)
if "tile_path" in event["pathParameters"]:
path = "/" + event["pathParameters"]["tile_path"]
if "proxy" in event["pathParameters"]:
path = "/" + event["pathParameters"]["proxy"]
else:
return {
"statusCode": 500,