From 27a054d985b7a994dc49597fad6b721013c972ea Mon Sep 17 00:00:00 2001 From: Bennett Wetters Date: Sat, 4 Nov 2023 22:42:37 +0100 Subject: [PATCH] Add README --- README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..eb58b77 --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +# SpaceAPI Daemon + +`spaceapid` serves a [SpaceAPI](https://spaceapi.io)-compatible JSON on port +8080: + +```shell +curl -X GET http://localhost:8080 +``` + +The state of the boolean `state->open` property can be modified via +`/state/open`: + +```shell +curl -X PUT -u user:password -d true http://localhost:8080/state/open +``` + +## Building + +See the `go.mod` file for minimum required Go version. There are currently no +dependencies other than the Go standard library. + +```shell +go build . +``` + +## Running + +Substitute the environment variables with appropriate custom values. + +```shell +env DOORIS_USERNAME=user DOORIS_PASSWORD=password SPACE_API_JSON="$(cat ccchh-template.json)" go run . +```