https://github.com/hassanakbar/i_m_freezing
https://github.com/hassanakbar/i_m_freezing
rails redis rspec ruby sidekiq
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hassanakbar/i_m_freezing
- Owner: HassanAkbar
- Created: 2019-04-14T17:12:51.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-14T18:11:02.000Z (about 7 years ago)
- Last Synced: 2025-08-12T00:47:18.812Z (11 months ago)
- Topics: rails, redis, rspec, ruby, sidekiq
- Language: Ruby
- Homepage:
- Size: 68.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# README
This README would normally document whatever steps are necessary to get the
application up and running.
## Rails Installation and Setup
Things you may want to cover:
* Ruby version : 2.6.2
* Rails version : 5.2.2
* Database : mysql
* Setup your database
```bash
rails db:create
```
* Run migrations
```bash
rails db:migrate
```
* Database Upload Sample Thermostats
```bash
rake db:seed
```
* How to run the test suite
```bash
rspec spec
```
* How to run Sidkiq
```bash
bundle exec sidekiq
```
## Sample Curl Requests
* Create Reading
```curl
curl -H 'household_token:81ed1639d2a7cad24be17a5e0724bc39' -d 'reading[thermostat_id]=1' -d 'reading[temperature]= 15' -d 'reading[humidity]=11' -d 'reading[battery_charge]=10' -X POST \http://localhost:3000/readings.json
```
* Show Reading
```curl
curl -H 'household_token:81ed1639d2a7cad24be17a5e0724bc39' -X GET \http://localhost:3000/readings/1.json
```
* Therostat Stats
```curl
curl -H 'household_token:81ed1639d2a7cad24be17a5e0724bc39' -X GET \http://localhost:3000/thermostats/1/stats.json
```