ubclaunchpad / minutes

:telescope: Speaker diarization via transfer learning
https://medium.com/ubc-launch-pad-software-engineering-blog/speaker-diarisation-using-transfer-learning-47ca1a1226f4
27 stars 5 forks source link

Add stub for audio upload endpoint #53

Closed iKevinY closed 7 years ago

iKevinY commented 7 years ago

:construction_worker: Changes

Adds a simple POST endpoint at /upload that can accept file uploads. For now, the endpoint just returns some basic information about the uploaded file (ie. name, type, size, and the leading bytes of the file). Closes #46.

:flashlight: Testing Instructions

Build the server and upload a file via a POST request.

$ make build-prod && make run

# Using cURL:
$ curl -i -X POST -F "file=@${PATH_TO_FILE}" http://localhost:80/upload

# Using HTTPie:
$ http -f POST :80/upload file@${PATH_TO_FILE}

The server should respond with some information like this:

{
  "filename": "nature24270.pdf",
  "leading_bytes": "b'%PDF-1.3\\n%\\xc4\\xe5\\xf2\\xe5\\xeb\\xa7\\xf3\\xa0\\xd0\\xc4\\xc6\\n6 0 o",
  "mimetype": "application/octet-stream",
  "size": 7752280
}

:hourglass: Status: Open for Visibility :tickets: Ticket(s): #46