GET /favourites

This returns all of the books that are currently favourited, i.e. their favourited property = true

Endpoint URL

http://127.0.0.1:8080/api/favourites

Example code

const loadFavourites = async () => {
    try {
        const response = await fetch("http://127.0.0.1:8080/api/favourites");
        const books = await response.json();
        return books;
    } catch (error) {
        console.error("Error fetching favourites data:", error);
        throw error;
    }
};

Example response

The books that are returned will all have "favourited": true

{
    "_id": 36,
    "newrelease": false,
    "title": "Hello! HTML5 & CSS3",
    "isbn": "1935182897",
    "pageCount": 325,
    "publishedDate": {
      "$date": "2012-10-17T00:00:00.000-0700"
    },
    "thumbnailUrl": "https://s3.amazonaws.com/AKIAJC5RLADLUMVRPFDQ.book-thumb-images/crowther.jpg",
    "shortDescription": "Quick and Easy HTML5 and CSS3 is written for the web designer or developer who wants a fast, example-oriented introduction to the new HTML and CSS features. After a quick review of the basics, you'll turn to what's new. Start by learning to apply important new elements and attributes by building your first real HTML5 pages. You'll then take a quick tour through the new APIs: Form Validation, Canvas, Drag & Drop, Geolocation and Offline Applications. You'll also discover how to include video and audio on your pages without plug-ins, and how to draw interactive vector graphics with SVG.",
    "longDescription": "HTML and CSS are the foundation of the web, and HTML5 and CSS3 are the latest standards. If you build web pages, mobile apps, or do any type of development at all, you'll have to learn HTML5 and CSS3, so why not start now  Quick and Easy HTML5 and CSS3 will give you a smart, snappy, and fun introduction to building web sites with these really cool new tools.    Quick and Easy HTML5 and CSS3 is written for the web designer or developer who wants a fast, example-oriented introduction to the new HTML and CSS features. After a quick review of the basics, you'll turn to what's new. Start by learning to apply important new elements and attributes by building your first real HTML5 pages. You'll then take a quick tour through the new APIs: Form Validation, Canvas, Drag & Drop, Geolocation and Offline Applications. You'll also discover how to include video and audio on your pages without plug-ins, and how to draw interactive vector graphics with SVG.    Once you've explored the fundamentals of HTML5, it's time to add some style to your pages with CSS3. New CSS features include drop shadows, borders, colors, gradients and backgrounds. In addition, you'll learn to layout your pages with the new flexible box and layout modules, and add the finishing touches with custom fonts. You'll also see how to target specific devices with media queries, and do all of it with less code thanks to the new selectors and pseudo classes.    Finally you will walk through several large examples where you see all the features of HTML5 and CSS3 working together to produce responsive and lightweight applications which you can interact with just like native desktop apps.",
    "status": "PUBLISH",
    "authors": [
      "Rob Crowther"
    ],
    "categories": [
      "Internet"
    ],
    "favourited": true
}, .....

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, for all of these books it will be set to true

Last updated