I'm building a real time chat application like Whatsapp. I have a websocket server with node+express, but I'm a bit confused on which flow I should use.
I'm considering sending the image as binary data through the websocket to the server, process it and store it in AWS s3, and then send the URL back to the user.
Another idea I have thought about is making have an endpoint to make a PUT request to the server, store that Image in S3, and then checking for the specific chatroom id in MongoDB, and then send the Url through websocket.
Can someone aware me on a better solution than what I currently have?