Skip to content

railsgirlssb/humure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Watchers

Forks

Releases

No releases published

Packages

No packages published