Skip to content

Latest commit

 

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Humure

The Humidity and temperature sensors app

API Calls

GET /humidity

$ curl -H "Accept: application/json" -H "X-Sensor: fake" -H "X-Token: team_a" localhost:3000/api/humidity
{"value":65}

GET /temperature

$ curl -H "Accept: application/json" -H "X-Sensor: fake" -H "X-Token: team_a" localhost:3000/api/temperature
{"value":24.50}

GET /lamp

$ curl -H "Accept: application/json" -H "X-Sensor: fake" -H "X-Token: team_a" localhost:3000/api/lamp
{"value":"off"}

PUT /lamp/on

$ curl -H "Accept: application/json" -H "X-Sensor: fake" -H "X-Token: team_a" -X PUT -d '' localhost:3000/api/lamp/on
{"value":"on"}

PUT /lamp/off

$ curl -H "Accept: application/json" -H "X-Sensor: fake" -H "X-Token: team_a" -X PUT -d '' localhost:3000/api/lamp/off
{"value":"off"}

PUT /lamp/color/240/65/36

$ curl -H "Accept: application/json" -H "X-Sensor: fake" -H "X-Token: team_a" -X PUT -d '' localhost:3000/api/lamp/color/240/65/36
{"value":[240,65,36]}

Local Production mode

For starting up on the pi without a real webserver, you need to start as follows:

export RAILS_SERVE_STATIC_FILES=true
export RAILS_ENV=production
export SECRET_KEY_BASE=$( rails secret )

rails s

About

Humidity and temperature sensors app

Resources

Stars

0 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages