Cookbook
Each page here shows how to do one task. It has one short program and the output of that program. Copy the part you need into your own code.
- Read a JSON body reads the JSON that a client sends into a class.
- Validate a form checks each field of a contact form.
- Page through database rows reads a table a few rows at a time.
- Save an uploaded file writes a file from a form to a folder.
- Call an HTTP API sends a request to another server and reads the JSON reply.
- Send a signed link makes a link that stops working after one hour.
- Store a password saves a hash and checks a login against it.
- Keep a value in a cookie stores a value the client cannot read or change.
- Cache a slow result computes a value once and reuses it.
- Forget a deleted row keeps loaded rows in memory and removes a deleted one at once.
- Schedule a job runs a program every Monday morning.
Some tasks need a permission in nvs.toml when they run on a server, for example to write files.
The page shows that file when the task needs one.
