{"id":24542958,"url":"https://github.com/aishanipach/restful-api","last_synced_at":"2026-04-11T09:04:40.186Z","repository":{"id":166931914,"uuid":"642415567","full_name":"Aishanipach/RESTful-API","owner":"Aishanipach","description":"Express \u0026 Node.js to create a sleek CRUD RESTful API.","archived":false,"fork":false,"pushed_at":"2024-02-18T17:29:00.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-13T12:49:25.483Z","etag":null,"topics":["api","api-rest","beginner-friendly","beginner-project","database","express","mongodb","mongodb-atlas","mongoose","nodejs","nodejs-api","web-application"],"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/Aishanipach.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,"zenodo":null}},"created_at":"2023-05-18T14:11:30.000Z","updated_at":"2023-05-19T18:09:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"8f284da0-663c-4411-bb94-7344c3f7d829","html_url":"https://github.com/Aishanipach/RESTful-API","commit_stats":null,"previous_names":["aishanipach/restful-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Aishanipach/RESTful-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aishanipach%2FRESTful-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aishanipach%2FRESTful-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aishanipach%2FRESTful-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aishanipach%2FRESTful-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aishanipach","download_url":"https://codeload.github.com/Aishanipach/RESTful-API/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aishanipach%2FRESTful-API/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31674624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T08:18:19.405Z","status":"ssl_error","status_checked_at":"2026-04-11T08:17:08.892Z","response_time":54,"last_error":"SSL_read: 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":["api","api-rest","beginner-friendly","beginner-project","database","express","mongodb","mongodb-atlas","mongoose","nodejs","nodejs-api","web-application"],"created_at":"2025-01-22T19:19:50.928Z","updated_at":"2026-04-11T09:04:40.169Z","avatar_url":"https://github.com/Aishanipach.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RESTful-API\n\nExpress \u0026amp; Node.js to create a sleek CRUD RESTful API. Models for payload validation to casually throw 400 client side errors💁‍♀️\n\n![MongoDB](https://img.shields.io/badge/MongoDB-%234ea94b.svg?style=for-the-badge\u0026logo=mongodb\u0026logoColor=white) ![Postman](https://img.shields.io/badge/Postman-FF6C37?style=for-the-badge\u0026logo=postman\u0026logoColor=white) ![Studio](https://img.shields.io/badge/Studio3T-16b57f?style=for-the-badge\u0026logo=studio3t\u0026logoColor=white) ![VS](https://img.shields.io/badge/VSCode-0078D4?style=for-the-badge\u0026logo=visual%20studio%20code\u0026logoColor=white) ![JSON](https://img.shields.io/badge/json-5E5C5C?style=for-the-badge\u0026logo=json\u0026logoColor=white) ![Express](https://img.shields.io/badge/Express.js-000000?style=for-the-badge\u0026logo=express\u0026logoColor=white)\n\n## What is difference between req.query \u0026 req.params in mongoose controllers?\n\n.params only get the route parameters while .query gets query strings passed.\n\n### .query\n\nGET localhost:3000/contact/contactId/?contactId=_(Id)_\n\ncrmRoutes.js\n\n```\napp.route(\"/contact/contactId\")\n.get(getContactById)\n```\n\ncrmControllers.js\n\n```\nexport const getContactById = (req, res) =\u003e {\n    const Id = req.query.contactId\n    console.log(Id)\n    const name = req.query.fname\n    Contact.findById(Id).then(contact =\u003e res.json(contact)).catch(err =\u003e (console.log(err)));\n}\n```\n\n### .params\n\nGET localhost:3000/contact/_(Id)_\n\ncrmRoutes.js\n\n```\n  app.route(\"/contact/:contactId\")\n```\n\ncrmControllers.js\n\n```\nexport const getContactById = (req, res) =\u003e {\n    const Id = req.params.contactId\n    console.log(Id)\n    Contact.findById(Id).then(contact =\u003e res.json(contact)).catch(err =\u003e (console.log(err)));\n}\n\n```\n\n### Resources:\n\n1. https://mongoosejs.com/docs/tutorials/findoneandupdate.html\n2. https://www.geeksforgeeks.org/mongoose-findoneandupdate-function/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faishanipach%2Frestful-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faishanipach%2Frestful-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faishanipach%2Frestful-api/lists"}