Kludex/starlette ? reverse-engineered prompt

Reverse engineered prompt

Build me a lightweight Python web framework for async apps, something like a small but polished ASGI toolkit for building HTTP services and WebSocket apps.

I want it to feel production ready, with routing, request and response helpers, background tasks, startup and shutdown hooks, CORS, GZip, static files, streaming responses, cookies and session support, plus a test client so I can easily write tests. It should work with both asyncio and trio, and keep the API simple enough that I can use pieces of it on their own if I want.

Please include a tiny example app, good documentation, and solid tests. Keep the code clean, fast, and fully typed where possible. If anything depends on current ecosystem details, look up the latest docs online before coding.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab