This is a simple project which runs one container based on the balena simple-server-node repository that demonstrates how to set device tags from within your application.
This project serves up "Hello World!" on port :80 of your balena device and additionally:
- Demonstrates how to use CURL to set tags (in the application's
start.sh).- sets the
device_tags_node.last_application_starttag with the current timestamp when the application starts.
- sets the
- Demonstrates how to use the javascript balena-SDK in the application's
device_tags_node/server.js.- sets the
device_tags_node.last_server_starttag with the current timestamp whenever the node server starts. - sets the
device_tags_node.last_requesttag with the current timestamp whenever the node server responds to an HTTP request.
- sets the
- Demonstrates how to use the python balena-SDK in the application's
device_tags_python/src/app.py. To try to python version, you need to uncomment the respective section in the docker-compose.yml.- sets the
device_tags_python.last_server_starttag with the current timestamp whenever the python server starts. - sets the
device_tags_python.last_requesttag with the current timestamp whenever the python server responds to an HTTP request.
- sets the
Check out the instructions in the balena simple-server-node repository to get started.
The scripts use the BALENA_API_KEY environment variable, which is injected to the environment of all balena applications, to authenticate all requests.