Skip to content

Commit

Permalink
feat: Update server to handle file process
Browse files Browse the repository at this point in the history
  • Loading branch information
cballevre committed Feb 2, 2024
1 parent 26610d7 commit 9b9f76e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import pymongo
import io

from process import process_file

DEFAULT_PORT = "8080"

app = Flask(__name__)
Expand All @@ -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__":
Expand Down

0 comments on commit 9b9f76e

Please sign in to comment.