{"id":23382222,"url":"https://github.com/rishabhraj43/express-microservices-starter-pack","last_synced_at":"2026-05-08T17:39:56.317Z","repository":{"id":268657244,"uuid":"905068542","full_name":"RishabhRaj43/Express-Microservices-Starter-Pack","owner":"RishabhRaj43","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-18T05:28:46.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T08:49:17.772Z","etag":null,"topics":["cors","express","express-http-proxy","microservices"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/RishabhRaj43.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-12-18T05:15:26.000Z","updated_at":"2024-12-18T05:49:48.000Z","dependencies_parsed_at":"2024-12-18T13:19:55.186Z","dependency_job_id":null,"html_url":"https://github.com/RishabhRaj43/Express-Microservices-Starter-Pack","commit_stats":null,"previous_names":["rishabhraj43/express-microservices-starter-pack"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RishabhRaj43/Express-Microservices-Starter-Pack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RishabhRaj43%2FExpress-Microservices-Starter-Pack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RishabhRaj43%2FExpress-Microservices-Starter-Pack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RishabhRaj43%2FExpress-Microservices-Starter-Pack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RishabhRaj43%2FExpress-Microservices-Starter-Pack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RishabhRaj43","download_url":"https://codeload.github.com/RishabhRaj43/Express-Microservices-Starter-Pack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RishabhRaj43%2FExpress-Microservices-Starter-Pack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32791116,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["cors","express","express-http-proxy","microservices"],"created_at":"2024-12-21T21:19:00.434Z","updated_at":"2026-05-08T17:39:56.300Z","avatar_url":"https://github.com/RishabhRaj43.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Express-Microservices-Starter-Pack\n\nThis project serves as a starter pack for building **microservices** using **Express.js**. It provides a basic structure for creating modular microservices, handling JSON, managing file uploads, and efficiently processing FormData.\n\nThe primary goal of this project is to implement a scalable and modular microservices architecture where services can interact with each other, and handle requests, including form data and file uploads, efficiently.\n\n## Libraries Used\n\nThe following libraries are used in this project to handle different functionalities:\n\n1. **Express** - Web framework for Node.js.\n   - Used for building the microservices, handling routing, and managing middleware.\n\n2. **Multer** - Middleware for handling `multipart/form-data` (used for file uploads).\n   - Handles form data including file uploads and text data in a clean and efficient way.\n\n3. **CORS** - Middleware to enable Cross-Origin Resource Sharing (CORS).\n   - Allows for secure cross-origin requests and data sharing between different origins.\n\n4. **express-http-proxy** - Proxy middleware for Express.js.\n   - Used for forwarding requests from one service to another in the microservices architecture. It enables efficient communication between services, especially in distributed systems.\n\n5. **body-parser** (optional) - Middleware to parse incoming request bodies.\n   - Helps parse JSON and URL-encoded data (though in this project, `multer` is preferred for handling form data).\n\n## Important Notes\n\n### 1. **Do Not Use `express.json()` Globally**\n\nAvoid using `express.json()` at the root level (e.g., in the main Express app). This is because `express.json()` will consume the request body, preventing other middlewares, such as **multer** for handling file uploads, from accessing the request body. \n\nInstead, use **multer** for handling all types of form data (even if the form only contains text data). This allows you to manage file uploads and form data correctly without issues.\n\n### 2. **Use `multer` for File Handling**\n\nFor handling any form data (including text and file uploads), **always use `multer`**. The following example demonstrates how to handle form data, including files:\n\n```javascript\nconst multer = require('multer');\n\nconst upload = multer();\n\napp.post('/upload', upload.any(), (req, res) =\u003e {\n  console.log(\"Request: \", req.body);\n  res.json({ message: \"FormData Received\", data: req.body });\n});\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frishabhraj43%2Fexpress-microservices-starter-pack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frishabhraj43%2Fexpress-microservices-starter-pack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frishabhraj43%2Fexpress-microservices-starter-pack/lists"}