From 9b9f76e970c4cf4d012a48ae99c21d194fbb9089 Mon Sep 17 00:00:00 2001 From: cballevre Date: Fri, 2 Feb 2024 08:23:45 +0100 Subject: [PATCH] feat: Update server to handle file process --- src/server.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/server.py b/src/server.py index 49804f8..7c503f7 100644 --- a/src/server.py +++ b/src/server.py @@ -12,6 +12,8 @@ import pymongo import io +from process import process_file + DEFAULT_PORT = "8080" app = Flask(__name__) @@ -26,8 +28,10 @@ def resource_not_found(e): @app.route("/", methods=HTTP_METHODS) def root(): print(request.get_data(), flush=True) - response = make_response("Hello from container") - return response + data = json.loads(b'{"file_id":"65bbdcd4b4b804782a5a35e5"}') + print(f"Processing file n°{data['file_id']}") + result = process_file(data['file_id']) + return result if __name__ == "__main__":