Skip to content

hawariMuflihMunte/bookshelf-hapi-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bookshelf-hapi-api

# Run

By default, this API runs on endpoint /books and on port 9000
You can access it with http://{url}:9000/books


# Get All Books

  • 'GET'
  • http://{url}:9000/books

# Get Book by ID

  • 'GET'
  • http://{url}:9000/books/{id}

# Add Book

  • 'POST'
  • http://{url}:9000/books
  • body
{
    "name": "My Book",
    "year": "2023",
    "author": "John Doe",
    "summary": "Lorem ipsum dolor sit amet",
    "publisher": "MyBook",
    "pageCount": "26",
    "readPage": "25",
    "reading": "false"
}
  • name can't be an empty string
  • readpage can't be larger than pageCount

# Edit Book by ID

  • 'PUT'
  • http://{url}:9000/books/{id}

# Delete Book by ID

  • 'DELETE'
  • http://{url}:9000/books/{id}


Educational purposes only