2023-11-04 22:42:37 +01:00
|
|
|
# SpaceAPI Daemon
|
|
|
|
|
2023-11-04 23:30:26 +01:00
|
|
|
`spaceapid` serves a [SpaceAPI](https://spaceapi.io)-compatible JSON on port 8080:
|
2023-11-04 22:42:37 +01:00
|
|
|
|
|
|
|
```shell
|
|
|
|
curl -X GET http://localhost:8080
|
|
|
|
```
|
|
|
|
|
2023-11-04 23:30:26 +01:00
|
|
|
The state of the boolean `state->open` property can be modified via `/state/open`:
|
2023-11-04 22:42:37 +01:00
|
|
|
|
|
|
|
```shell
|
|
|
|
curl -X PUT -u user:password -d true http://localhost:8080/state/open
|
|
|
|
```
|
|
|
|
|
|
|
|
## Building
|
|
|
|
|
2023-11-04 23:30:26 +01:00
|
|
|
See the `go.mod` file for minimum required Go version. There are currently no dependencies apart from the Go
|
|
|
|
standard library.
|
2023-11-04 22:42:37 +01:00
|
|
|
|
|
|
|
```shell
|
|
|
|
go build .
|
|
|
|
```
|
|
|
|
|
|
|
|
## Running
|
|
|
|
|
|
|
|
Substitute the environment variables with appropriate custom values.
|
|
|
|
|
|
|
|
```shell
|
2023-11-05 20:25:44 +01:00
|
|
|
env BA_USERNAME=user BA_PASSWORD=password JSON_TEMPLATE_PATH=ccchh-template.json go run .
|
2023-11-04 22:42:37 +01:00
|
|
|
```
|