Spaces:
Sleeping
Sleeping
Download app/api/add.py from pardeep-singh/reading-list: direct link, hf CLI and curl.
- Browser
- Download file 321 Bytes
-
https://huggingface.co/spaces/pardeep-singh/reading-list/resolve/main/app/api/add.py
- Command line
-
hf download hf://spaces/pardeep-singh/reading-list/app/api/add.py
-
curl -L -o add.py https://huggingface.co/spaces/pardeep-singh/reading-list/resolve/main/app/api/add.py
321 Bytes
| from fastapi import APIRouter, Depends | |
| from app.models import Book, BookCreate | |
| from app.store import BookStore, get_store | |
| router = APIRouter() | |
| def create_book(data: BookCreate, store: BookStore = Depends(get_store)) -> Book: | |
| return store.add(data) | |