shizuko-akamoto / Trecipe

CPSC 436I Project (2020S)
1 stars 3 forks source link

Implement photo upload for trecipe #94

Closed shizuko-akamoto closed 4 years ago

shizuko-akamoto commented 4 years ago

Added UploadService and controller on backend to save given file as bytes in MongoDB using GridFS library.

The client receives the filename that identifies the uploaded file and we store it in Trecipe object (in the image field). When retrieving image, we set the src of tag to get endpoint with the stored image filename like so:

url(${baseURL}upload/${this.props.imageSource})

baseURL is the localhost:7000/api/v1 part.