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

Commit

Permalink
Make the API response meaningful
Browse files Browse the repository at this point in the history
  • Loading branch information
JonZeolla committed Aug 20, 2020
1 parent f18d41d commit 34e644a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ make deploy
```
1. Get your REST api ID
```bash
awsdocker "aws apigateway get-rest-apis | jq -r '.[][][\"id\"]'
awsdocker "aws apigateway get-rest-apis | jq -r '.[][][\"id\"]'"
```
1. Query the lambda via API Gateway.
```bash
Expand Down
2 changes: 1 addition & 1 deletion client.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def main():
)

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


def get_args_config() -> Dict:
Expand Down
7 changes: 6 additions & 1 deletion lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from typing import Dict
import sys
import json
from argparse import ArgumentParser
import requests

Expand All @@ -14,11 +15,15 @@ def lambda_handler(event, context):
AWS Lambda handler
"""
print(event)
check_for_commit(
status = check_for_commit(
account=event["queryStringParameters"]["account"],
repository=event["queryStringParameters"]["repository"],
commitish=event["queryStringParameters"]["commit"],
)
response_code = 200
body = json.dumps({'status': status})
response = {'statusCode': response_code, 'body': body}
return response


def main():
Expand Down

0 comments on commit 34e644a

Please sign in to comment.