add kontor-blacksheep and kontor-piccolo as blueprints for new app
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import os
|
||||
|
||||
import jinja2
|
||||
from starlette.endpoints import HTTPEndpoint
|
||||
from starlette.responses import HTMLResponse
|
||||
|
||||
ENVIRONMENT = jinja2.Environment(
|
||||
loader=jinja2.FileSystemLoader(
|
||||
searchpath=os.path.join(os.path.dirname(__file__), "templates")
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
class HomeEndpoint(HTTPEndpoint):
|
||||
async def get(self, request):
|
||||
template = ENVIRONMENT.get_template("home.html.jinja")
|
||||
|
||||
content = template.render(
|
||||
title="Piccolo + ASGI",
|
||||
)
|
||||
|
||||
return HTMLResponse(content)
|
||||
Reference in New Issue
Block a user