This service accepts a file upload with a size limit of 1000KB. Once uploaded, it will return the file size in bytes in the JSON response. Note: This service is removing the file from the server right after sending the json response because the upload files are not being managed for this project.
You can test it at https://file-metadata-micro-srvc.herokuapp.com
A Full Stack Javascript application built using Node.js, Express and Multer. An API Project for FreeCodeCamp.
You can drag or select a file from your computer and preview the file to upload. Once you click the upload button, the POST request is sent to the '/get-file-size/' API endpoint.
The server responds back with the file name and file size in the JSON response.
{
file_name: "Maribel.jpg",
file_size: "568599 bytes"
}
In order to run this project locally, you should have the following installed:
- Fork this repo
- Clone the fork
- Install Dependencies:
$ npm install
- Start the Server:
$ node app.js
- Visit http://localhost:3000/
Enjoy! 💙