This example is heavily based on the tutorial in the Mongoose documentation:
https://github.com/mongoose-examples/raspberry-pi-pico-w/blob/5bfae33/lwipopts.h#L86-L92
See it in action! https://i.imgur.com/tnN3QpD.gif
Make sure you have docker
, gcc
and make
installed on your system.
Install gzip
on your platform, then run gzip on your web artificts like .html
and .js
. Don't bother with things like images because they are usually already compressed.
- Compile
pack.c
into a binary that runs on your local system withcc -o pack pack.c
- Then run pack your assets in the folder
./web_root
i.e../pack <List of filenames>
Use make build
to compile the project.
main.c
is where you define the task methods, their priorities and where you dispatch the tasks. It also contains some code to enable a DHCP server and hotspot for the pi pico.net.c
All of the web server API stuff goes in here.