{"id":25782049,"url":"https://github.com/sgrisak/coffee-rest-api","last_synced_at":"2026-04-16T10:02:44.126Z","repository":{"id":279152153,"uuid":"937854221","full_name":"sgrisak/coffee-rest-api","owner":"sgrisak","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-18T02:49:16.000Z","size":714,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-01T04:18:56.611Z","etag":null,"topics":["express","javascript","node","rest-api"],"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/sgrisak.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-24T02:33:42.000Z","updated_at":"2025-03-18T02:49:20.000Z","dependencies_parsed_at":"2025-11-15T12:02:35.245Z","dependency_job_id":null,"html_url":"https://github.com/sgrisak/coffee-rest-api","commit_stats":null,"previous_names":["sgrisak/coffee-rest-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sgrisak/coffee-rest-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgrisak%2Fcoffee-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgrisak%2Fcoffee-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgrisak%2Fcoffee-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgrisak%2Fcoffee-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sgrisak","download_url":"https://codeload.github.com/sgrisak/coffee-rest-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgrisak%2Fcoffee-rest-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31880884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T09:23:21.276Z","status":"ssl_error","status_checked_at":"2026-04-16T09:23:15.028Z","response_time":69,"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":["express","javascript","node","rest-api"],"created_at":"2025-02-27T07:35:51.912Z","updated_at":"2026-04-16T10:02:44.121Z","avatar_url":"https://github.com/sgrisak.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Coffee REST API\n\nA simple REST API for managing coffee products. Built with Node.js and Express.\n\n## Features\n\n- CRUD operations for coffee products\n- RESTful endpoint structure\n- JSON response format\n- In-memory data storage\n\n## Prerequisites\n\n- Node.js (v14.0.0 or higher)\n- npm (v6.0.0 or higher)\n\n## Installation\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/sgrisak/coffee-rest-api.git\ncd coffee-rest-api\n```\n\n2. Install dependencies:\n\n```bash\nnpm install\n```\n\n3. Start the server:\n\n```bash\nnode app.js\n```\n\nThe server will start running at `http://localhost:3000`.\n\n## API Documentation\n\n### Base URL\n\nAll endpoints are relative to: `http://localhost:3000/api`\n\n### Endpoints\n\n#### Get All Coffees\n\n- **URL:** `/coffees`\n- **Method:** `GET`\n- **cURL:** `curl -X GET http://localhost:3000/api/coffees`\n- **Success Response:**\n  - **Code:** 200\n  - **Content Example:**\n    ```json\n    [\n      {\n        \"id\": 1,\n        \"name\": \"Ethiopian Yirgacheffe\",\n        \"roast\": \"Light\",\n        \"price\": 16.99,\n        \"origin\": \"Ethiopia\"\n      },\n      {\n        \"id\": 2,\n        \"name\": \"Colombian Supremo\",\n        \"roast\": \"Medium\",\n        \"price\": 14.99,\n        \"origin\": \"Colombia\"\n      }\n    ]\n    ```\n\n#### Get Single Coffee\n\n- **URL:** `/coffees/:id`\n- **Method:** `GET`\n- **cURL:** `curl -X GET http://localhost:3000/api/coffees/1`\n- **URL Params:** `id=[integer]`\n- **Success Response:**\n  - **Code:** 200\n  - **Content Example:**\n    ```json\n    {\n      \"id\": 1,\n      \"name\": \"Ethiopian Yirgacheffe\",\n      \"roast\": \"Light\",\n      \"price\": 16.99,\n      \"origin\": \"Ethiopia\"\n    }\n    ```\n- **Error Response:**\n  - **Code:** 404\n  - **Content:** `{ \"message\": \"Coffee not found\" }`\n\n#### Create Coffee\n\n- **URL:** `/coffees`\n- **Method:** `POST`\n- **cURL:**\n\n```bash\ncurl -X POST http://localhost:3000/api/coffees/2 \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"name\": \"Yemen Mocha Matari\",\n    \"roast\": \"Medium-Light\",\n    \"price\": 21.99,\n    \"origin\": \"Yemen\"\n  }'\n```\n\n- **Data Params:**\n  ```json\n  {\n    \"name\": \"Yemen Mocha Matari\",\n    \"roast\": \"Medium-Light\",\n    \"price\": 21.99,\n    \"origin\": \"Yemen\"\n  }\n  ```\n- **Success Response:**\n  - **Code:** 201\n  - **Content:** Returns the created coffee object with ID\n\n#### Update Coffee\n\n- **URL:** `/coffees/:id`\n- **Method:** `PUT`\n- **cURL:**\n\n```bash\ncurl -X PUT http://localhost:3000/api/coffees/2 \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"name\": \"string\",\n    \"roast\": \"string\",\n    \"price\": \"number\",\n    \"origin\": \"string\"\n  }'\n```\n\n- **URL Params:** `id=[integer]`\n- **Data Params:** Any of the following fields:\n  ```json\n  {\n    \"name\": \"string\",\n    \"roast\": \"string\",\n    \"price\": \"number\",\n    \"origin\": \"string\"\n  }\n  ```\n- **Success Response:**\n  - **Code:** 200\n  - **Content:** Returns the updated coffee object\n- **Error Response:**\n  - **Code:** 404\n  - **Content:** `{ \"message\": \"Coffee not found\" }`\n\n#### Delete Coffee\n\n- **URL:** `/coffees/:id`\n- **Method:** `DELETE`\n- **cURL:** `curl -X DELETE http://localhost:3000/api/coffees/3`\n- **URL Params:** `id=[integer]`\n- **Success Response:**\n  - **Code:** 204\n- **Error Response:**\n  - **Code:** 404\n  - **Content:** `{ \"message\": \"Coffee not found\" }`\n\n## Future Improvements\n\n- Add database integration\n- Add input validation\n- Add filtering and search capabilities\n- Add Swagger/OpenAPI documentation\n- ~~Add cURL examples~~\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgrisak%2Fcoffee-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsgrisak%2Fcoffee-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgrisak%2Fcoffee-rest-api/lists"}