Update code in endpoints\books.get.py
This commit is contained in:
parent
ef6bae8843
commit
9a30538b53
13
endpoints/books.get.py
Normal file
13
endpoints/books.get.py
Normal file
@ -0,0 +1,13 @@
|
||||
from fastapi import APIRouter, Depends, HTTPException
|
||||
from core.database import fake_books_db
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.get("/books")
|
||||
async def get_books_handler():
|
||||
"""Get all books in the library"""
|
||||
books = list(fake_books_db.values())
|
||||
return {
|
||||
"message": "Books retrieved successfully",
|
||||
"data": books
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user