Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nejdetkadir/nodejs-book-api
NodeJS simple books restful API (used MongoDB)
https://github.com/nejdetkadir/nodejs-book-api
api mongodb mongoose nodejs rest-api restful restful-api travis-ci
Last synced: 9 days ago
JSON representation
NodeJS simple books restful API (used MongoDB)
- Host: GitHub
- URL: https://github.com/nejdetkadir/nodejs-book-api
- Owner: nejdetkadir
- License: mit
- Created: 2020-10-06T20:43:34.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-07T21:59:25.000Z (about 4 years ago)
- Last Synced: 2024-12-06T03:08:05.665Z (21 days ago)
- Topics: api, mongodb, mongoose, nodejs, rest-api, restful, restful-api, travis-ci
- Language: JavaScript
- Homepage: https://nodejs-books-api.herokuapp.com
- Size: 141 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build status](https://api.travis-ci.org/nejdetkadir/nodejs-book-api.svg)](https://api.travis-ci.org/nejdetkadir/nodejs-book-api)
# Books
| Route | HTTP Verb | Post Body | Description |
| --- | --- | --- | --- |
| /api/books | `GET` | Empty | List all books. |
| /api/books | `POST` | {'name':'The Lord of the Rings', 'category':'Epic', 'publisher':'Metis Yayınları', 'year':1954, 'likes': 9157, 'author_id':"id"} | Create a new book. |
| /api/books/:book_id | `GET` | Empty | Get single book. |
| /api/books/:book_id | `PUT` | {'category':'History', 'year':2000} | Update a book with new info. |
| /api/books/:book_id | `DELETE` | Empty | Delete a book. |
| /api/books/top/:top_id | `GET` | Empty | Get the top books with your limit. |
| /api/books/year/:start_year/:end_year | `GET` | Empty | Books between two dates. |# Authors
| Route | HTTP Verb | Post Body | Description |
| --- | --- | --- | --- |
| /api/authors | `GET` | Empty | List all authors and theirs books. |
| /api/authors | `POST` | {'name': 'J. R. R.', 'surname':'Tolkien', 'bio':'Lorem ipsum dolor sit amet'} | Create a new author. |
| /api/authors/:author_id | `GET` | Empty | Get single author and their books. |
| /api/authors/:author_id | `PUT` | {'bio': 'Lorem ipsum dolor sit amet, consectetur adipiscing elit'} | Update a author with new info. |
| /api/authors/:author_id | `DELETE` | Empty | Delete a author. |# Index
| Route | HTTP Verb | POST Body | Description |
| --- | --- | --- | --- |
| /register | `POST` | { username: 'loremipsum', password:'1234' } | Create a new user. |
| /authenticate | `POST` | { username: 'loremipsum', password:'1234' } | Generate a token. |# Demo
[Live demo on Heroku](https://nodejs-books-api.herokuapp.com/)# LICENSE
This Application is licensed under the MIT license.