Lanes – Lightweight Async Web Framework for MicroPython
Lanes is a lightweight, asynchronous web framework for MicroPython, designed to run efficiently on resource-constrained devices like ESP32, ESP8266, and RP2040. It provides routing, middleware, blueprints, static file serving, cookie handling, and JSON support – all in a familiar Flask-like syntax.
Version: 1.0.0-pre
Status: Stable for development / Experimental on some boards
✨ Features
- 🌐 Async from the ground up – Built on
asynciofor concurrent request handling. - 🧩 Blueprint support – Modularise your application.
- ⚙️ Middleware support – Run code before each request.
- 🗂️ Static file serving – Serve CSS, JS, images, etc.
- 📍 Dynamic routing – Extract URL parameters (
/user/:id). - 🍪 Cookie handling – Set and read cookies easily.
- 📦 JSON auto‑serialisation – Return
dict/listas JSON. - 📝 Configurable logging – DEBUG, INFO, WARN, ERROR, FATAL.
- 🧪 Error handlers (soon to be fully functional).
- 🚀 Tiny memory footprint – Suitable for ESP32 with ~300KB free heap.
📦 Installation
- Copy
lanes.pyto your MicroPython device (e.g., viaampy,mpremote, or WebREPL). - No additional dependencies – uses only built-in modules:
asyncio,json,os,time.
```bash
Example using mpremote
mpremote cp lanes.py :/lib/lanes.py