initial commit
This commit is contained in:
commit
95b8af2360
15 changed files with 1519 additions and 0 deletions
19
views.py
Normal file
19
views.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
from fastapi import APIRouter, Depends, Request
|
||||
from fastapi.responses import HTMLResponse
|
||||
from lnbits.core.models import User
|
||||
from lnbits.decorators import check_user_exists
|
||||
from lnbits.helpers import template_renderer
|
||||
|
||||
castle_generic_router = APIRouter(tags=["castle"])
|
||||
|
||||
|
||||
@castle_generic_router.get(
|
||||
"/", description="Castle accounting home page", response_class=HTMLResponse
|
||||
)
|
||||
async def index(
|
||||
request: Request,
|
||||
user: User = Depends(check_user_exists),
|
||||
):
|
||||
return template_renderer(["castle/templates"]).TemplateResponse(
|
||||
request, "castle/index.html", {"user": user.json()}
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue