This is my file metadata microservice for freeCodeCamp's last API project. Demo is available on my site. You can also check out my other freeCodeCamp projects.
- I can submit a form object that includes a file upload.
- The form file input field has the
name
attribute set toupfile
. We rely on this in testing. - When I submit something, I will receive the file name, and size in bytes within the JSON response.
POST
a file to the /api/filedata
endpoint or go to the main page and upload a file using the provided form.
{
"name": "dnd.gif",
"type": "image/gif",
"size": 1256227
}
- ESLint linter with Airbnb's base config
- Express.js framework
- Multer middleware to handle form data
- Jest test framework
- Pug template engine
- Supertest library
git clone https://github.com/zsoltime/fcc-api-file-metadata.git
cd fcc-api-file-metadata
npm install
It starts a dev server, monitor for changes and restarts on any change.
npm run dev
It starts the node.js application.
npm start
It runs tests using Jest and Supertest.
npm test