From 02ac315df618709bde2170ce8aea62011a19fd41 Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Fri, 22 Jul 2022 00:33:37 +0800 Subject: [PATCH] change API gateway path param to 'proxy' --- serverless/aws/README.md | 2 +- serverless/aws/lambda_function.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/serverless/aws/README.md b/serverless/aws/README.md index 1caa8e0..cebaab6 100644 --- a/serverless/aws/README.md +++ b/serverless/aws/README.md @@ -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 diff --git a/serverless/aws/lambda_function.py b/serverless/aws/lambda_function.py index d4b79be..c2bfb90 100644 --- a/serverless/aws/lambda_function.py +++ b/serverless/aws/lambda_function.py @@ -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,