In the final installment of my Padrino + Ember series I’d like to show you how to get some basic realtime functionality within our application. We’ll be using Pusher to send and receive messages. They have a pretty reasonable free package which includes 100k messages per day, 20 max connections and SSL if you need it.
In the last article I went through how to implement authorisation with Ember-simple-auth and Padrino. The next logical step is to implement authorisation with the same toolset.
While thinking about what to write for this week’s article it occured that I never touched on authentication with Ember and Padrino in my previous articles. So I think this is the perfect excuse to continue with the series! Follow along for creating a Padrino backend that works with Ember-simple-auth and the authentication library Ember-simple-auth-devise.
I am using the following library versions for this tutorial:
- IO.js v1.2.0
- NPM 2.5.1
- watchman 3.0.0 (Installed with homebrew)
- Ember 1.8.1
- Ember Data 1.0.0-beta.14.1
- jQuery 1.11.2
- Handlebars 1.3.0
After listening to the Ruby Rogues’ Padrino episode I was sold on the idea of using Padrino for smaller websites and simple API’s. I know Grape is also a perfect contender for building an Ember APIs but:
I am already familiar with Sinatra so the learning curve shouldn’t be as steep.
I wanted to get to know Padrino.
Funsies. I’m going to show you how to quickly set up both together, build a restful API compatible with Ember’s
ActiveModelAdapterand show you a few gotchas to help you on your way.