REST API example.
$ up
$ curl -d Tobi https://example.com/
welcome to the family "Tobi"!
$ curl -d Loki https://example.com/
welcome to the family "Loki"!
$ curl -d Jane https://example.com/
welcome to the family "Jane"!
$ curl https://example.com/
- Tobi
- Jane
- Loki
There's no need to wrap pets
in a mutex since
Lambda processes only a single request per container
concurrently.
Don't actually rely on local state like this, use a database. In-memory state is only useful for caching in a Lambda container.