{"id":19044792,"url":"https://github.com/salvillalon45/filemetadata-freecodecamp","last_synced_at":"2026-04-28T12:34:42.335Z","repository":{"id":218978422,"uuid":"747838197","full_name":"salvillalon45/fileMetadata-freeCodeCamp","owner":"salvillalon45","description":"A REST API to get the metadata of your uploaded file","archived":false,"fork":false,"pushed_at":"2024-02-01T20:20:04.000Z","size":13476,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-21T23:29:56.266Z","etag":null,"topics":["express-js","javacript","multer","nodejs","render","rest-api","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/salvillalon45.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-24T18:34:35.000Z","updated_at":"2024-02-01T20:30:32.000Z","dependencies_parsed_at":"2024-01-24T20:29:06.596Z","dependency_job_id":"f5f55e03-facd-4748-b3b7-65247073783d","html_url":"https://github.com/salvillalon45/fileMetadata-freeCodeCamp","commit_stats":null,"previous_names":["salvillalon45/filemetadata-freecodecamp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/salvillalon45/fileMetadata-freeCodeCamp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salvillalon45%2FfileMetadata-freeCodeCamp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salvillalon45%2FfileMetadata-freeCodeCamp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salvillalon45%2FfileMetadata-freeCodeCamp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salvillalon45%2FfileMetadata-freeCodeCamp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/salvillalon45","download_url":"https://codeload.github.com/salvillalon45/fileMetadata-freeCodeCamp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salvillalon45%2FfileMetadata-freeCodeCamp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32381686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T11:25:28.583Z","status":"ssl_error","status_checked_at":"2026-04-28T11:25:05.435Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["express-js","javacript","multer","nodejs","render","rest-api","typescript"],"created_at":"2024-11-08T22:47:29.468Z","updated_at":"2026-04-28T12:34:42.310Z","avatar_url":"https://github.com/salvillalon45.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# File Metadata\n\nfreeCodeCamp - Back End Development and APIs | Project: File Metadata\n\n# Summary\n\nCreate a File Metadata REST API that you upload a file in the HTML view, you will get back a JSON response with the file name, type, and size in bytes of the uploaded file!\n**[Learn more about the Project Task.](https://www.freecodecamp.org/learn/back-end-development-and-apis/back-end-development-and-apis-projects/file-metadata-microservice)**\n\nIt has the folowing:\n\n-   **/api/fileanalyse** - **POST**: Use `Multer` npm package for handling multipart/form-data. `Multer` is used for uploading files!\n-   Response Example: `{ \"name\": \"test_image.png\", \"type\": \"image/png\", \"size\": 124002 }`\n\n-   **views/index.html**\n\n    -   Contains the view for users to upload the file\n\n### Implementation\n\n-   Created a TypeScript + Express API\n-   Created the `routes/api.ts` to organize the routes that the api will use\n-   Created the `controllers/fileUploadController.ts`. It contains all the api controllers that the routes will use to do the logic on each api call\n-   Created `utils/index.ts` contains the `PORT` the server will listen to\n-   Created the `uploadFileAnalyse` API Controller. This controller extracts the metadata which is `mimetype`, `size`, and `originalname` from the `req.file` and send it as a `JSON` response\n-   In the controller I set up `multer` by doing the following\n    ```\n    import multer from 'multer';\n    const upload = multer({ dest: 'uploads/' });\n    ```\n-   `multer` will create an `uploads` directory where all the files will be stored\n-   Attached the `upload.single('upfile')` middleware to place the uploaded file in the `req.file`. `upfile` is the name used in the name attribute of the input tag in index.html!\n-   Created one route along with their api controller and `multer` support:\n    -   `router.post('/fileanalyse', upload.single('upfile'), uploadFileAnalyse);`\n\n### Resources\n\n-   Use the tutorial for learning how to use `multer`! [Multer: Easily upload files with Node.js and Express\n    ](https://blog.logrocket.com/multer-nodejs-express-upload-file/#install-configure-multer)\n\n### Demo\n\nhttps://github.com/salvillalon45/fileMetadata-freeCodeCamp/assets/18276475/8a999d75-c4e1-4faf-be24-09245f8de637\n\n\n# Technologies:\n\n-   JavaScript\n-   TypeScript\n-   Render\n-   Multer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalvillalon45%2Ffilemetadata-freecodecamp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalvillalon45%2Ffilemetadata-freecodecamp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalvillalon45%2Ffilemetadata-freecodecamp/lists"}