Skip to content
Demonstration scripts on how to use the resin.io API & SDK to set device tags from within your app.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
tags_api
.dockerignore
.gitignore
Dockerfile.template
README.md
package-lock.json
package.json
server.js
start.sh

README.md

Using the balena API & SDK to set device tags from within apps.

This is a simple project 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:

  • sets the stats.laststart tag with the current timestamp when the application starts.
    • This is done using CURL in the application's start.sh.
  • sets the stats.lastrequest tag with the current timestamp whenever the node server responds to an HTTP request.
    • This is done using the javascript balena-SDK in the application's server.js.

Setup

Check out the instructions in the balena simple-server-node repository to get started.

Authentication

The scripts use the RESIN_API_KEY environment variable, which is injected to the environment of all balena applications, to authenticate all requests.

You can’t perform that action at this time.