Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/balena-io-examples/balena-go-hello-world
Example of how to deploy Go code on a balena supported device.
https://github.com/balena-io-examples/balena-go-hello-world
balena balena-hello-world golang
Last synced: 22 days ago
JSON representation
Example of how to deploy Go code on a balena supported device.
- Host: GitHub
- URL: https://github.com/balena-io-examples/balena-go-hello-world
- Owner: balena-io-examples
- License: apache-2.0
- Created: 2016-10-11T15:09:45.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-04-19T17:36:21.000Z (8 months ago)
- Last Synced: 2024-11-25T09:43:26.452Z (28 days ago)
- Topics: balena, balena-hello-world, golang
- Language: JavaScript
- Homepage: https://www.balena.io/docs/learn/getting-started/raspberrypi3/go/
- Size: 103 KB
- Stars: 16
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: license.md
Awesome Lists containing this project
README
# A Simple server with Go net/http package
[![balena deploy button](https://www.balena.io/deploy.svg)](https://dashboard.balena-cloud.com/deploy?repoUrl=https://github.com/balena-io-examples/balena-go-hello-world)
This is a simple skeleton Go server project that works on any of the [devices supported][devices-supported] by [balena][balena-link].
This project serves up a welcome page on port `:80` of your balena device.
To get this project up and running, you will need to [sign-up][signup-page] for a balena account. Have a look at our [Getting Started tutorial][gettingStarted-link] to help you kickstart your journey in creating a fleet of devices. Once you are set up with balena, you will need to clone or download this repository.
After downloading, navigate to the directory and run the `balena push` command using the [balena CLI][balena-cli]. This command will package up and push the code to the balena builders, where it will be compiled, built and deployed to every device in the fleet. When it completes, you'll have a Go powered web server running on your device and you can see some logs on your [device dashboard][balena-dashboard].
```bash
cd balena-go-hello-world/
balena push
```To give your device a public URL, access the device page on the [balenaCloud dashboard][balena-dashboard], and choose the _Public Device URL_ toggle. Once the device is updated, check the Public Device URL to find the welcome page showing up from your device. That's it, you have deployed your first balena device!
[balena-cli]:https://www.balena.io/docs/reference/cli/
[balena-dashboard]:https://dashboard.balena-cloud.com/
[balena-link]:https://balena.io/
[devices-supported]:https://www.balena.io/docs/reference/hardware/devices/
[gettingStarted-link]:https://www.balena.io/docs/learn/getting-started/raspberrypi3/go/
[signup-page]:https://dashboard.balena-cloud.com/signup