More skeleton
This commit is contained in:
parent
cc65c91726
commit
702b67ad66
4 changed files with 66 additions and 302 deletions
22
views.py
Normal file
22
views.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import json
|
||||
from http import HTTPStatus
|
||||
|
||||
from fastapi import Depends, Request, HTMLResponse
|
||||
from fastapi.templating import Jinja2Templates
|
||||
from loguru import logger
|
||||
|
||||
from lnbits.core.models import User
|
||||
from lnbits.decorators import check_user_exists
|
||||
|
||||
from . import nostrmarket_ext, nostrmarket_renderer
|
||||
|
||||
|
||||
templates = Jinja2Templates(directory="templates")
|
||||
|
||||
|
||||
@nostrmarket_ext.get("/", response_class=HTMLResponse)
|
||||
async def index(request: Request, user: User = Depends(check_user_exists)):
|
||||
return nostrmarket_renderer().TemplateResponse(
|
||||
"nostrmarket/index.html",
|
||||
{"request": request, "user": user.dict()},
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue