Articles tagged 'facebook'

Blog Projects

Facebook POST for Canvas fix

Latest usage and examples can be found from Rack::Facebook::MethodFix project page.

In early 2011 Facebook started to send all iframe application requests as POST. Because of this most REST based applications broke. Lets say you have object called User. To get list of users in RESTful application you would issue the following request:

GET /users/

New user is created with POST request:

POST /users/

I’m sure you can spot the problem here. You try to retrieve list of users. That does not work. Instead you end up creating new object because your request was converted to POST.

Continue reading >>

Rake Tasks For Easier Facebook Development

Lets face it. Facebook development is tedious. You do not want to waste more time in endless commit-push-pull-restart loop for smallest code changes. Common development setup is to tunnel traffic from development server to your laptop using ssh tunnel. Here are my Rake tasks for switching between production and development mode.

Facebook Application Stack

I use Sinatra, Thin, Sinbook and DataMapper for all my Facebook development. All static assets are served by Apache. Apache also proxies other requests to Sinatra using mod_rewrite. Proxying is easiest to setup using the following rule in .htaccess file:

  RewriteEngine On
  RewriteBase /

  # Everything not found goes to Sinatra / Rack
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule (.*){REQUEST_URI} [L,P,QSA]

Continue reading >>

Built using the awesome Flat UI Pro framework by Designmodo.

© 2016 Mika Tuupola.