Repository navigation
examples/net: add httphi versions of webserver and webstatic - #931
Conversation
|
The smoke test fails because the webserver-httphi example does not fit in flash on arduino-nano33 (overflow of 174944 bytes). The httphi package imports log/slog, which in turn imports encoding/json. TinyGo 0.43.0, which CI uses, does not remove that unused code, so the binary is about 430 KB. With TinyGo 0.44.0-dev the same example is 139 KB and builds fine. Holding this PR until TinyGo 0.44 is released and CI picks it up. |
|
Noslog build tag does not work to exclude the slog package? That would be an issue in lneto |
|
You are right, |
85ac40e to
3c6e9c9
Compare
Use the heapless httphi router from github.com/soypat/lneto instead of net/http. This uses about a third of the flash and half the static RAM, and lets webserver fit on the arduino-nano33. Bumps go.mod to go 1.24 as required by lneto.
3c6e9c9 to
e507ba0
Compare
|
@soypat PTAL |
soypat
left a comment
There was a problem hiding this comment.
very strict allocation discipline, very nice. Also noticed a few things I want to keep in mind to possibly improve httphi ux.
|
Thanks for review @soypat now merging. |
Adds
webserver-httphiandwebstatic-httphi. They do the same thing as the existingwebserverandwebstaticexamples but use the heapless httphi router instead ofnet/http.Size (flash / static RAM):
httphi allocates its buffers once at startup and nothing per request.
lneto requires Go 1.24, so
go.modis bumped from 1.22.1 to 1.24.Tested on nano-rp2040. Smoketest entries added.