Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 34e644a

Browse files
committed
Make the API response meaningful
1 parent f18d41d commit 34e644a

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ make deploy
1818
```
1919
1. Get your REST api ID
2020
```bash
21-
awsdocker "aws apigateway get-rest-apis | jq -r '.[][][\"id\"]'
21+
awsdocker "aws apigateway get-rest-apis | jq -r '.[][][\"id\"]'"
2222
```
2323
1. Query the lambda via API Gateway.
2424
```bash

client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def main():
4343
)
4444

4545
response = getattr(requests, method.lower())(url, auth=auth)
46-
print("Request sent. Hope it worked :shrug:")
46+
print(f"{response.content}")
4747

4848

4949
def get_args_config() -> Dict:

lambda_function.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from typing import Dict
77
import sys
8+
import json
89
from argparse import ArgumentParser
910
import requests
1011

@@ -14,11 +15,15 @@ def lambda_handler(event, context):
1415
AWS Lambda handler
1516
"""
1617
print(event)
17-
check_for_commit(
18+
status = check_for_commit(
1819
account=event["queryStringParameters"]["account"],
1920
repository=event["queryStringParameters"]["repository"],
2021
commitish=event["queryStringParameters"]["commit"],
2122
)
23+
response_code = 200
24+
body = json.dumps({'status': status})
25+
response = {'statusCode': response_code, 'body': body}
26+
return response
2227

2328

2429
def main():

0 commit comments

Comments
 (0)