Space API endpoint for Coredump Hackerspace, written in Rust.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Coredump Space API Implementation

Build Status Docker Repository on Quay

This is our implementation of the Space API v0.13 in Rust. We're using the spaceapi and spaceapi-server crates to simplify the implementation.

Space API Documentation:


To get the current SpaceAPI status object:


To update a sensor value, send a PUT request to the sensor endpoint:

PUT /sensors/<data_key>/ value=<value>

Examples for curl and httpie:

$ curl -v -X PUT -d value=42.1337
$ http --form put :3000/sensors/people_now_present/ value=3



Use Cargo to build:

$ cargo build

Then you can start the spaceapi server:

$ cargo run

You can also specify a different ip or port:

$ cargo run -- -i -p 1337

To specify another Redis instance than redis://, set the REDIS_HOST, REDIS_PORT and/or REDIS_DB env variables.


If you want to see logging, set the RUST_LOG env variable:

$ cargo build
$ RUST_LOG=warn target/debug/coredump_status

You can also show logs only from a specific crate:

$ RUST_LOG=spaceapi_server=debug cargo run



To use the redis storage start the redis server:

$ redis-server

(...or start it using your favorite init daemon.)

You can access the database with the redis-cli tool:

% redis-cli> SET people_now_present 1
OK> GET people_now_present
"1"> KEYS *
1) "people_now_present"


We currently store data in the following redis keys:

  • people_now_present (integer)
  • raspi_temperature (float)
  • room_temperature (float)

Docker Image

To build the docker image based on the current codebase:

$ docker build -t coredump/status:latest .

If you want to test this using a redis database, first launch a redis container:

$ docker run -d --name spaceapi-redis redis:3.0

Then launch a new container from the image:

$ export PORT=3000
$ docker run -d --name spaceapi -p$PORT:3000 --link spaceapi-redis coredump/status

(If you don't need a datastore, you can also leave away the redis container and the --link argument.)

To stop it again:

$ docker stop spaceapi
$ docker stop spaceapi-redis

The docker image at will be automatically rebuilt on every push to master.