sinatra api framework
by chris.blazek on 2012/05/18
I’ve been throwing around ideas for my smart home system for a while now. Mostly dreaming, but in doing so I’ve come up with little programming challenges that have given me the opportunity to design/develop real world solutions outside my daily programming scope. My current idea is to create a RESTful API in ruby with an apikey and user authentication. I would like to create it so that it wouldn’t take much for someone to drop a new “module” into the project and run with it.
I have chosen sinatra to build off of. I ran across rack_throttle which will give me the ability to identify clients by ip address, api key, cookies, headers, etc. I believe autowatcher will give me the moduler portion of the design.
I’ve got 2 really simple API calls for testing that pull stats from my thermostat to start with in the sinatra environment. This was really easy and only took a couple minutes to get up and running.
I have an iOS app that I’m building in conjunction with this project to test the api as it develops. I’m going to move the thermostat code it’s own module after I find the best way to handle that flow.
Please feel free to fork and send your pull requests. I’m open to the best practices and ways to accomplish this.
git fork git://github.com/kingbin/kgbhomeAPI.git
My install of the ruby gem memcached was throwing up all over the place. I fixed this by installing libsasl2-dev.
sudo apt-get install libmemcached-dev libsasl2-dev libmemcached-dbg




