8000 GitHub - Silverfolk/Books-API
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Silverfolk/Books-API

Repository files navigation

Book API

This API consists of 2 tables Authors and Books all values in there is being generated by faker.js and is used to perform operations between them.

Installation

Install project with npm on terminal

  npm install

API Reference

Logging In for User

  POST /api/login

Logging Out for the User

  POST /api/logout

Author API Reference

Author has the following attributes:- name,password,email,phone,BooksLiked,books

To return the response of all the authors in the database with number of books published by that autho

  GET /api/authors

To return the details of the author with the given author id with list of books

  GET /api/authors/:id

To return the details of the logged-in author

  GET /api/authors/me

Books API Reference

Books has the following attributes:- title,author,likes

To return the list of all the books.Remember that this url will need query parameter "asc" for ascending order sort and "desc" for descending order sort of likes.

  GET /api/books?sort=(desc or asc)

To like a book

  PUT /api/books/like/:id

To unlike a book

 PUT /api/books/unlike/:id

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

ACCESS_TOKEN_SECRET=e75cb3acca9e971c85df4ad92c27a9e82d1592b2823e7e1fa9e16a028e39448c3fb40bf4b705ae3cde58a460127f2e57c8860db9bb5617eb8717a0c7ba2e8c9c

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0