Also may be of serious consideration to people looking at microdot, because:
* Pure asyncio only, zero dependencies.
* Ships its own ASGI server, like Sanic. (No juggling uvicorn and gunicorn dependencies).
* Tiny library, feels like Starlette from the glory days.
* streaming responses by default (return stuff, then do processing, return more stuff).
* handles streaming multipart form uploads / streaming downloads, without external dependencies.
* tons of safeguards built in (request/response size limits, bandwidth throttling!) No massive DoS exploit potential found in Starlette/Uvicorn/FastAPI lol.
* the intuitive Sanic-style @on_request + @on_response rather than the complex middleware system in Starlette nowadays
Only 2,500 lines, with IMHO, far more important features than Starlette/FastAPI already baked in.
> Sometimes applications need to store data during the lifetime of a request, so that it can be shared between the before or after request handlers and the route function. The request object provides the g attribute for that purpose.
`g` is short for "global", but it is global to that request only. This makes data available to hooks which can wrap request handlers before/after they execute
It's inspired by Flask's same functionality, though it's a part of the greater Application Context and Request Context in Flask, which Microdot apparently doesn't have:
30 comments
[ 3.5 ms ] story [ 77.1 ms ] threadhttps://en.wikipedia.org/wiki/Microdot
Turns out microdot is a tiny format for communicating text/image which seems an apt name for this tiny webserver.
Probably what the LSD format was named after originally.
See also https://mikrodot.bandcamp.com/
1: https://phish.net/song/mikes-song/history
Also may be of serious consideration to people looking at microdot, because:
* Pure asyncio only, zero dependencies.
* Ships its own ASGI server, like Sanic. (No juggling uvicorn and gunicorn dependencies).
* Tiny library, feels like Starlette from the glory days.
* streaming responses by default (return stuff, then do processing, return more stuff).
* handles streaming multipart form uploads / streaming downloads, without external dependencies.
* tons of safeguards built in (request/response size limits, bandwidth throttling!) No massive DoS exploit potential found in Starlette/Uvicorn/FastAPI lol.
* the intuitive Sanic-style @on_request + @on_response rather than the complex middleware system in Starlette nowadays
Only 2,500 lines, with IMHO, far more important features than Starlette/FastAPI already baked in.
https://github.com/encode/starlette
https://github.com/miguelgrinberg/microdot
https://github.com/nggit/tremolo
may I remind you of https://groups.google.com/g/comp.os.minix/c/dlNtH7RRrGA/m/Sw...
> I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones.
;)
I remember when Starlette and FastAPI were both just starting in the double digits. IMO this is 100% a sleeper project based on the qualities above.
I wast just checking this for creating a small web management interface for an ESP32 light controller and some other sensors.
Eh I dont get it. "g" for globals?
It's inspired by Flask's same functionality, though it's a part of the greater Application Context and Request Context in Flask, which Microdot apparently doesn't have:
https://flask.palletsprojects.com/en/2.3.x/appcontext/#stori...