Facebook App Development on Localhost
This was perhaps the most annoying problem while developing an App for Facebook. Still, the workaround is not that bad. The problem is I think that unless Facebook had an specific token to relate a request to a certain App (instead of using the predefined callback) it would be possible to have localhost:port-number as an app domain, but that wouldn't make any sense either because that's not really the domain your App is running at, am I right? So one solution is a really quick __workaround__ with your `hosts` file and to modify the callback address to match your localhost:port so that your OS will catch the domain within the `hosts` file, redirect it invisibly to 127.0.0.1 and use the port you specified to access the application server running on your localhost. Simple, and works. So let's dive right ###The Hosts file On UNIX or UNIX-like system you are most likely going to find this file at `/etc/hosts` and will also most likely need to `sudo` to modify it. On Windows I recall performing at simple search in my Windows installation directory and the file being hidden, but it shouldn't be a big deal to find it anyway.  __Side-note: I like to use Python/CoffeeScript as the syntax so the comments are properly highlighted, but as you can see this file usually doesn't have an extension.__
https://gist.github.com/4241326
###The App Normally this will vary from platform to platform, and from framework to framework as well, but also normally you would have a "callbackUrl" that would most likely look something like `/auth/facebook/callback`, and a host url that most likely will not be set because the framework has a default value that would point to localhost. If you were in a server that would make sense but since we are trying to lie to Facebook about the domain name of our app and where it points to, we will need to change that to `yourapp.domain[:port]` --where the port is completely optional.  Here is a little snippet to doing this in `node` with `everyauth` (assuming `env` holds your current environment configuration in a single string, like "development" or "production" or "testing"):
https://gist.github.com/4241431
Other frameworks for other platforms might have different ways of doing this, but I'm quite sure that after being pointed out **what to do** it's gonna be just as easy for you guys to get it going. I'm also working on a little side project using Express with EveryAuth that already implements this. I'm going to release it anytime soon so stay tuned! See you soon.















