diff --git a/README.md b/README.md index 0741248..ca9945f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1 @@ -# 4835b8a718594a3ca130aa9ec49d0d5a - +# python hello-world diff --git a/main.py b/main.py new file mode 100644 index 0000000..b1f90ca --- /dev/null +++ b/main.py @@ -0,0 +1,14 @@ +def main(request): + # Parse the input from the request (assumes JSON input) + request_json = request.get_json(silent=True) + if not request_json or 'num1' not in request_json or 'num2' not in request_json: + return "Please provide 'num1' and 'num2' in the request JSON" + + try: + # Extract numbers from the request + num1 = float(request_json['num1']) + num2 = float(request_json['num2']) + result = num1 + num2 + return {"result": result} + except ValueError: + return "Please provide valid numbers" \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..55e8614 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +functions-framework==1.4.3 +markupsafe==2.0.1