Returns the list of books from the library, will be helpful if you are trying to display all of the books at once
Endpoint URL
http://127.0.0.1:8080/api/books
Example code
constloadBooks=async()=>{try{constresponse=awaitfetch("/api/books");constbooks=awaitresponse.json(); // Sort the books by _idbooks.sort((a,b)=>a._id-b._id);returnbooks;}catch (error) {console.error("Error fetching books data:",error);throwerror;}};
Example response
This only shows the first book but all books in the library will be returned, this is not recommended to be called regularly as it can be quite taxing on a machine and slow down your users browser
Response fields
Name
Type
Description
_id
integer
This is the identification number, which is unique to each specific book
newrelease
Boolean
A Boolean value to determine whether or not the book is a new release and would therefore show up in the new release section if this is true
title
string
The title of the book
isbn
string
The International Standard Book Number for this specific book
pageCount
integer
The number of pages in the book, all pages are included
publishedDate
date
The date at which this copy of the book was first published
thumbnailUrl
string
Image URL for the thumbnail or cover of the book
shortDescription
string
A short description of the book, acting as a blurb
longDescription
string
A more extensive description which covers the major points of the book
status
string
Whether or not the book is currently published, so far all the books in the library are
authors
array of strings
An array of all authors who contributed to the book
categories
array of strings
The listed genres / categories of the book as all books are non-fiction at the moment
favourited
Boolean
Whether or not the book is a favourite for the user, as no identification system is being used, this is a global property
[
{
"_id": 1,
"newrelease":false,
"title": "Unlocking Android",
"isbn": "1933988673",
"pageCount": 416,
"publishedDate": {
"$date": "2009-04-01T00:00:00.000-0700"
},
"thumbnailUrl": "https://s3.amazonaws.com/AKIAJC5RLADLUMVRPFDQ.book-thumb-images/ableson.jpg",
"shortDescription": "Unlocking Android: A Developer's Guide provides concise, hands-on instruction for the Android operating system and development tools. This book teaches important architectural concepts in a straightforward writing style and builds on this with practical and useful examples throughout.",
"longDescription": "Android is an open source mobile phone platform based on the Linux operating system and developed by the Open Handset Alliance, a consortium of over 30 hardware, software and telecom companies that focus on open standards for mobile devices. Led by search giant, Google, Android is designed to deliver a better and more open and cost effective mobile experience. Unlocking Android: A Developer's Guide provides concise, hands-on instruction for the Android operating system and development tools. This book teaches important architectural concepts in a straightforward writing style and builds on this with practical and useful examples throughout. Based on his mobile development experience and his deep knowledge of the arcane Android technical documentation, the author conveys the know-how you need to develop practical applications that build upon or replace any of Androids features, however small. Unlocking Android: A Developer's Guide prepares the reader to embrace the platform in easy-to-understand language and builds on this foundation with re-usable Java code examples. It is ideal for corporate and hobbyists alike who have an interest, or a mandate, to deliver software functionality for cell phones. WHAT'S INSIDE: * Android's place in the market * Using the Eclipse environment for Android development * The Intents - how and why they are used * Application classes: o Activity o Service o IntentReceiver * User interface design * Using the ContentProvider to manage data * Persisting data with the SQLite database * Networking examples * Telephony applications * Notification methods * OpenGL, animation & multimedia * Sample Applications ",
"status": "PUBLISH",
"authors": [
"W. Frank Ableson",
"Charlie Collins",
"Robi Sen"
],
"categories": [
"Open Source",
"Mobile"
],
"favourited": true
},
...