mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 19:01:08 +00:00
change API gateway path param to 'proxy'
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user