{"id":19154567,"url":"https://github.com/gitericsson/book-api-mongodb","last_synced_at":"2026-04-13T01:03:19.240Z","repository":{"id":251112512,"uuid":"836299457","full_name":"gitEricsson/Book-API-MongoDB","owner":"gitEricsson","description":"A RESTful API for managing a collection of books and storing in the MongoDB. The API supports basic CRUD (Create, Read, Update, Delete) operations.","archived":false,"fork":false,"pushed_at":"2024-11-17T17:03:07.000Z","size":599,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-03T19:28:59.097Z","etag":null,"topics":["api","express-js","mongodb","restful-api"],"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/gitEricsson.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-07-31T14:53:07.000Z","updated_at":"2024-11-17T17:03:10.000Z","dependencies_parsed_at":"2025-01-03T19:26:48.707Z","dependency_job_id":"d9ded94d-91f6-41c2-9a5c-84738d99b92e","html_url":"https://github.com/gitEricsson/Book-API-MongoDB","commit_stats":null,"previous_names":["gitericsson/book-api-mongodb"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitEricsson%2FBook-API-MongoDB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitEricsson%2FBook-API-MongoDB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitEricsson%2FBook-API-MongoDB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitEricsson%2FBook-API-MongoDB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gitEricsson","download_url":"https://codeload.github.com/gitEricsson/Book-API-MongoDB/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240238293,"owners_count":19769903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","express-js","mongodb","restful-api"],"created_at":"2024-11-09T08:27:22.552Z","updated_at":"2026-04-13T01:03:19.187Z","avatar_url":"https://github.com/gitEricsson.png","language":"TypeScript","readme":"# Books API\n\n## About\n\nA RESTful API for managing a collection of books. The API supports basic CRUD (Create, Read, Update, Delete) operations.\n\n## API endpoints\n\n### Get All Books\n\n- **URL:** `localhost:port/api/books`\n- **Method:** `GET`\n- **Description:** Retrieve a list of all books.\n- **Response:**\n  - `200 OK`: Returns a list of all books.\n\n### Create a New Book\n\n- **URL:** `localhost:port/api/books`\n- **Method:** `POST`\n- **Description:** Create a new book.\n- **Request Body:**\n  - `title` (string, required): The title of the book.\n  - `author` (string, required): The author of the book.\n  - `publishedYear` (number, required): The year the book was published.\n  - `ISBN` (string, required): The ISBN number of the book.\n- **Response:**\n  - `201 Created`: Returns the created book.\n\n### Get a Book by ID\n\n- **URL:** `localhost:port/api/books/:id`\n- **Method:** `GET`\n- **Description:** Retrieve details of a specific book by ID.\n- **Response:**\n  - `200 OK`: Returns the book details.\n\n### Update a Book by ID\n\n- **URL:** `localhost:port/api/books/:id`\n- **Method:** `PATCH`\n- **Description:** Update the details of a specific book by ID.\n- **Request Body:** Any book field that needs to be updated.\n- **Response:**\n  - `200 OK`: Returns the updated book.\n\n### Delete a Book by ID\n\n- **URL:** `localhost:port/api/books/:id`\n- **Method:** `DELETE`\n- **Description:** Delete a specific book by its ID.\n- **Response:**\n  - `204 No Content`: Indicates successful deletion.\n\n### Update Book Cover Image\n\n- **URL:** `localhost:port/api/books/cover-image/:id`\n- **Method:** `PATCH`\n- **Description:** Update the cover image of a specific book.\n- **Request:** Multipart form data with the key `photo` and the image file.\n- **Response:**\n  - `200 OK`: Returns the book with the updated cover image.\n\n## Getting started\n\n### Clone the repository\n\n```\n$ git clone https://github.com/gitEricsson/Books-API.git\ncd books-api\n```\n\n### Install dependencies\n\nAfter cloning book-management-api, install the dependencies by running:\n\n```\n$ npm install\n```\n\n### Initialize server\n\nTo start the server, run:\n\n```\n$ npm start\n```\n\n### Run tests\n\nTo run the tests, use the following command:\n\n```\n$ npm test\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitericsson%2Fbook-api-mongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitericsson%2Fbook-api-mongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitericsson%2Fbook-api-mongodb/lists"}