mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 10:51:07 +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`
|
* 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`
|
* `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
|
## Test Event
|
||||||
|
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ def lambda_handler(event, context):
|
|||||||
path = None
|
path = None
|
||||||
if event.get("pathParameters"):
|
if event.get("pathParameters"):
|
||||||
# API Gateway (HTTP or REST)
|
# API Gateway (HTTP or REST)
|
||||||
if "tile_path" in event["pathParameters"]:
|
if "proxy" in event["pathParameters"]:
|
||||||
path = "/" + event["pathParameters"]["tile_path"]
|
path = "/" + event["pathParameters"]["proxy"]
|
||||||
else:
|
else:
|
||||||
return {
|
return {
|
||||||
"statusCode": 500,
|
"statusCode": 500,
|
||||||
|
|||||||
Reference in New Issue
Block a user