ASGI server implementation with no dependencies, currently in development. This server is designed to handle ASGI applications and provides basic HTTP/1.1 support.
Note: This project is still under active development and is not yet production-ready. Contributions and feedback are welcome!
- ASGI Compliance: Compliant with the ASGI specification for asynchronous web servers.
- HTTP/1.1 Support: Currently supports HTTP/1.1 protocol.
- Lifespan Events: Handles ASGI lifespan events (
startup
andshutdown
) for proper application initialization and cleanup. - Signal Handling: Gracefully handles shutdown signals (
SIGTERM
andSIGINT
). - No Dependencies: The core server has zero external dependencies, making it lightweight and easy to integrate. (Note: optional dependencies are required only for running tests.)
You can try Navajo by cloning the repository and installing it locally.
git clone https://github.com/guuido/navajo.git
cd navajo
You can install Navajo in editable mode using pip
:
pip install -e .
To run tests or contribute to the project, install the optional development dependencies:
pip install -e ".[dev]"
To run the server with your ASGI application, use the run
function provided in the navajo
package:
from navajo import run
async def app(scope, receive, send):
assert scope["type"] == "http"
await send({
"type": "http.response.start",
"status": 200,
"headers": [
[b"content-type", b"text/plain"],
],
})
await send({
"type": "http.response.body",
"body": b"Hello, World!",
})
run(app)
To run the tests, ensure you have installed the optional development dependencies (pytest
and pytest-asyncio
). Then, use the following command:
pytest
Contributions are welcome! If you'd like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Submit a pull request with a detailed description of your changes.
This project is licensed under the MIT License. See the LICENSE file for details.