The an example of serving a SvelteKit app from an ESP32 microcontroller.
ESP32 is $2 microcontroller with intergrated WIFI and Bluetooth.
Tested with a WROOM-32 devkit
@sveltejs/adapter-static
.build
directory is synced to the flash using mpremote
. Thankfully Svelte bundles are very small, and can fit inside the microcontroller's flash. For larger projects, you can use an SD card.firmware
folder contains the Python code to connect to WIFI, and start an HTTP server to serve the SvelteKit build. Just copy it over to the ESP32 using mpremote
.# install the mpremote cli
pip install mpremote
# build svelte-kit project
pnpm build
# copy `build` folder to device
mpremote fs cp -r build :build
# run web server on device
mpremote run firmware/server.py
MIT