Create an ASGI App
Create a file calledapp.py:
async def app(scope, receive, send):
"""Minimal ASGI application."""
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 from Pounce!",
})
Serve It
pounce serve --app app:app
import pounce
pounce.run("app:app")
Openhttp://127.0.0.1:8000in your browser. You should see "Hello from Pounce!".
Enable Development Reload
pounce serve --app app:app --reload
Pounce watches your source files and restarts workers automatically when changes are detected.
The default watch set covers Python and config sources plus common static-site
authoring files —.md, .html, .css, .js, and .svg— so editing
content, templates, or styles also triggers a reload. The watcher scans the
current working directory, any--reload-dirpaths, and any configured
static-mount directories. Use--reload-include ".rst,.scss"to watch
extensions outside the default set.
Configure Workers
# Auto-detect worker count (based on CPU cores)
pounce serve --app app:app --workers 0
# Explicit 4 workers
pounce serve --app app:app --workers 4
Note
--workers 0auto-detects based on CPU cores. The default is 1 (single worker). On free-threaded Python 3.14t, workers run as threads sharing one interpreter. With the GIL enabled, workers run as separate processes.
App Factory Pattern
Pounce supports the app factory pattern with callable syntax:
pounce serve --app myapp:create_app()
This calls create_app() in the myappmodule and uses the returned ASGI application.