Added API mapping and custom Domain
This commit is contained in:
@@ -10,6 +10,7 @@ bucket_config = ''
|
||||
bucket_data = ''
|
||||
function_url = ''
|
||||
git_version = ''
|
||||
api_verson = ''
|
||||
s3_client = None
|
||||
redirects: Redirects | None = None
|
||||
|
||||
@@ -36,7 +37,7 @@ class Record(BaseModel):
|
||||
s3: S3Event
|
||||
|
||||
def lambda_handler(event: dict, context):
|
||||
global s3_client, bucket_config, bucket_data, function_url, redirects, git_version
|
||||
global s3_client, bucket_config, bucket_data, function_url, redirects, git_version, api_version
|
||||
|
||||
if s3_client is None:
|
||||
print("Init Function")
|
||||
@@ -44,6 +45,7 @@ def lambda_handler(event: dict, context):
|
||||
bucket_data = os.environ.get('BUCKET_DATA', 'standout-data')
|
||||
function_url = os.environ.get('FUNCTION_URL', 'https://api.standout.it/dev')
|
||||
git_version = os.environ.get('GIT_VERSION', '00000000')
|
||||
api_version = os.environ.get('API_VERSION', 'v1')
|
||||
|
||||
print(f' Version: {git_version}')
|
||||
print(f' Bucket Data: {bucket_data}')
|
||||
@@ -174,7 +176,7 @@ def processAdd(record: Record, redirects: Redirects, client) -> None:
|
||||
print(f"ObjectCreated: {record.s3.object.key}")
|
||||
|
||||
def generateTagUrl(cust_id: str, tag_id: str, face_id: str | None) -> str:
|
||||
return f"{function_url}/api?id={cust_id}&tag_id={tag_id}{f"&face_id={face_id}" if face_id else ""}"
|
||||
return f"{function_url}/{api_version}?id={cust_id}&tag_id={tag_id}{f"&face_id={face_id}" if face_id else ""}"
|
||||
|
||||
def searchCustomerKey(redirects: Redirects, cust_name: str, default: str | None) -> str | None:
|
||||
if redirects.customers is None:
|
||||
|
||||
Reference in New Issue
Block a user