Skip to content

litestar-org/litestar-hello-world

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Litestar Logo - Light Litestar Logo - Dark

Project Status
CI/CD ci Documentation Building
Quality Coverage Quality Gate Status Maintainability Rating Reliability Rating Security Rating
Package PyPI - Version PyPI - Support Python Versions Starlite PyPI - Downloads Litestar PyPI - Downloads
Community Reddit Discord Matrix Twitter Blog
Meta Litestar Project types - Mypy License - MIT Litestar Sponsors linting - Ruff code style - Black All Contributors

litestar-hello-world

Minimal Litestar Implementation.

Install PDM

Linux/Mac

curl -sSL https://pdm.fming.dev/install-pdm.py | python3 -

Windows

(Invoke-WebRequest -Uri https://pdm.fming.dev/install-pdm.py -UseBasicParsing).Content | python -

Install litestar

pdm install
pdm venv activate
litestar run --reload
curl localhost:8000/sync -w "\n" && curl localhost:8000/async -w "\n"

Litestar Development

If you want to use this app to test a local version of Litestar, change the litestar dependency in pyproject.toml to:

dev = [
    ...
    "litestar @ git+https://github.com/litestar-org/litestar.git",
]

...or you can add it manually with:

pdm add "git+https://github.com/litestar-org/litestar.git" --dev

Note

See PDM - Editable Dependencies for more info.

Run uvicorn or any other ASGI-compliant server from the root of this app:

Important

This assumes that Litestar and this app exist in the same directory.

pdm run uvicorn app:app --reload --reload-dir .

Code Quality

After cloning:

pre-commit install

Run on all files:

pre-commit run --all-files

Run a specific hook:

pre-commit run mypy --all-files

Docs

Important

TODO