reworked ebook_search routers
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from fastapi import APIRouter, Request
|
||||
from fastapi.responses import HTMLResponse
|
||||
@@ -13,19 +12,11 @@ from sqlalchemy.orm import Session
|
||||
from python.ebook_search.api.web import templates
|
||||
from python.orm.richie import EbookSource
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from fastapi import FastAPI
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
def register_page_routes(app: FastAPI) -> None:
|
||||
"""Register page routes on the app."""
|
||||
app.include_router(router)
|
||||
|
||||
|
||||
@router.get("/", response_class=HTMLResponse)
|
||||
def index(request: Request) -> HTMLResponse:
|
||||
"""Render the search page."""
|
||||
|
||||
Reference in New Issue
Block a user