Spaces:
Sleeping
Sleeping
Download app/api/notes/notes_get.py from bichnhan2701/NoteServicesAPI: direct link, hf CLI and curl.
- Browser
- Download file 426 Bytes
-
https://huggingface.co/spaces/bichnhan2701/NoteServicesAPI/resolve/main/app/api/notes/notes_get.py
- Command line
-
hf download hf://spaces/bichnhan2701/NoteServicesAPI/app/api/notes/notes_get.py
-
curl -L -o notes_get.py https://huggingface.co/spaces/bichnhan2701/NoteServicesAPI/resolve/main/app/api/notes/notes_get.py
426 Bytes
| from fastapi import APIRouter, HTTPException | |
| from app.services.note_store import get_note, list_notes | |
| router = APIRouter(prefix="/notes", tags=["notes"]) | |
| def get_notes(folder_id: str | None = None): | |
| return list_notes(folder_id) | |
| def get_note_by_id(note_id: str): | |
| note = get_note(note_id) | |
| if not note: | |
| raise HTTPException(404, "Note not found") | |
| return note |