Build a full stack app that is functionally similar to this: https://aryanj-file-size.herokuapp.com/.
-
User Story: I can submit a FormData object that includes a file upload.
-
User Story: When I submit something, I will receive the file size in bytes within the JSON response
Hint: You may want to use this package: https://www.npmjs.com/package/multer
Requirements:
- NodeJS
- NPM
- Docker (optional)
Run using NPM:
# install dependencies
npm install
# run app at localhost:8000
npm start
Run using Docker:
# build image
docker build -t pbgnz/file-metadata-microservice .
# run image
docker run -p 8000:8000 -d pbgnz/file-metadata-microservice
Usage
# submit webform image
http://localhost:8000
# post image via dataupload to
http://localhost:8000/upload