GET /books/length

This returns the number of books in the library currently

Endpoint URL

http://127.0.0.1:8080/api/books/length

Example code

const getNumberOfBooks = async () => {
    try {
        const response = await fetch("/api/books/length");
        const data = await response.json();
        return data.total;
    } catch (error) {
        console.error("Error fetching number of books data:", error);
        throw error;
    }
};

Example response

{"total":"134"}

Response fields

Names
Type
Description

total

integer

The total number of books in the library

Last updated