GET /books/length
This returns the number of books in the library currently
Endpoint URL
http://127.0.0.1:8080/api/books/lengthExample 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
Last updated