-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: enhance templates and various bug fixes
fix: cleanup templates; add default entry points
- Loading branch information
Showing
48 changed files
with
1,592 additions
and
1,812 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from __future__ import annotations | ||
|
||
from pathlib import Path | ||
|
||
from litestar import Controller, Litestar, get | ||
from litestar.response import Template | ||
|
||
from litestar_vite import ViteConfig, VitePlugin | ||
|
||
here = Path(__file__).parent | ||
|
||
|
||
class WebController(Controller): | ||
"""Web Controller.""" | ||
|
||
opt = {"exclude_from_auth": True} | ||
include_in_schema = False | ||
|
||
@get("/") | ||
async def index(self) -> Template: | ||
"""Serve site root.""" | ||
return Template(template_name="index.html.j2") | ||
|
||
|
||
vite = VitePlugin( | ||
config=ViteConfig( | ||
bundle_dir=Path(here / "public"), | ||
resource_dir=Path(here / "resources"), | ||
template_dir=Path(here / "templates"), | ||
hot_reload=True, | ||
port=3006, | ||
use_server_lifespan=True, | ||
dev_mode=True, | ||
), | ||
) | ||
app = Litestar(plugins=[vite], route_handlers=[WebController]) |
Oops, something went wrong.