<p>Typically I develop my websites on trunk, then merge changes to a testing branch where they are put on a 'beta' website, and then finally they are merged onto a live branch and put onto the live website.</p>

<p>With a Facebook application things are a bit tricky. As you can't view a Facebook application through a normal web browser (it has to go through the Facebook servers) you can't easily give each developer their own version of the website to work with and test.</p>

<p>I have not come across anything about the best way to develop and test a Facebook application while continuing to have a stable live website that users can use. My question is this, what is the best practice for organising the development and testing of a Facebook application?</p>

[{'answer_id': 39472, 'author': 'ryantm', 'author_id': 823, 'author_profile': 'https://Stackoverflow.com/users/823', 'pm_score': 5, 'selected': True, 'text': '<p>The way I and my partner did it was we each made our own private Facebook applications, that pointed to our IP address where we worked on it. Since we worked in the same place, we each picked a different port, and had our router forward that port to our local IP address. It was kinda slow to refresh a page, but it worked very nicely.</p>\n'}, {'answer_id': 39500, 'author': 'Dmitry Shechtman', 'author_id': 3583, 'author_profile': 'https://Stackoverflow.com/users/3583', 'pm_score': 3, 'selected': False, 'text': '<p>You\'ll have to add both trunk and test versions as different applications and test them using <a href="http://developers.facebook.com/news.php?blog=1&amp;story=35" rel="nofollow noreferrer">test accounts</a>. You may also use a single application and switch its target URL between cycles.</p>\n'}, {'answer_id': 110730, 'author': 'Toby Hede', 'author_id': 14971, 'author_profile': 'https://Stackoverflow.com/users/14971', 'pm_score': 3, 'selected': False, 'text': '<p>Testing FB apps is still a rather primitive process. </p>\n\n<p>I generally setup a test application that is a complete copy of the production settings inside the FB development environment that uses an SSH tunnel to point to my development server. You can setup as many applications as you need inside FB - I generally have a development application, a staging app and production. Staging and Production are both on "live" servers rather than an SSH tunnel. </p>\n\n<p>In your application you then use whatever language/framework/server tools are at your disposal to switch the FB configuration based on the server. In Rails, the Facebooker gem actually has built in support for different FB configurations.</p>\n\n<p>Once all of that is done, testing is, unfortunately, still a matter of running the app within FB itself. I use Selenium to automate as much of this as possible. </p>\n'}, {'answer_id': 445197, 'author': 'Arron S', 'author_id': 16628, 'author_profile': 'https://Stackoverflow.com/users/16628', 'pm_score': 5, 'selected': False, 'text': '<p>Try updating your hosts file <code>(for windows users @ c:\\windows\\System32\\Drivers\\etc\\hosts)</code>    with an entry that will route all requests from your live domain back to your machine.   </p>\n\n<p>So    <code>127.0.0.1  mywebappthatusesfacebook.com.</code>  </p>\n\n<p>Then make sure that your app is running at the root of your webserver. @ <a href="http://localhost/" rel="noreferrer">http://localhost/</a>      Then goto mywebappthatusesfacebook.com in your browser and it should redirect right back to your local machine.  Facebook won\'t know the difference.    Hope this helps</p>\n'}, {'answer_id': 6587737, 'author': 'Anna Billstrom', 'author_id': 830304, 'author_profile': 'https://Stackoverflow.com/users/830304', 'pm_score': 1, 'selected': False, 'text': "<p>We have it setup much like Toby. A series of config files for each developer, that has the Facebook APP Id info (a different app for each developer), separate pages where the app is hosted, and git ignores the config files. We're LAMP with Code Igniter, and it's similar to Rails in that we can set the environment in 1 file, which points to the config with the Facebook constants. </p>\n\n<p>Branching out into Selenium, using unit tests for model-testing. </p>\n"}, {'answer_id': 7744799, 'author': 'sbaechler', 'author_id': 477953, 'author_profile': 'https://Stackoverflow.com/users/477953', 'pm_score': 1, 'selected': False, 'text': "<p>For local testing we simply use a different app than for the server. In our case the Canvas-URL is set to localhost.local:8000.</p>\n\n<p>You only have to make sure that when you use facebook connect that you type in localhost.local into the address field of the browser and not just localhost. </p>\n\n<p>For testing a canvas or tab app it is faster if you use the 'open iframe in new tab' command of Firefox. This way the session and cookies from Facebook are preserved.</p>\n"}, {'answer_id': 10297513, 'author': 'Kris', 'author_id': 510853, 'author_profile': 'https://Stackoverflow.com/users/510853', 'pm_score': 2, 'selected': False, 'text': '<p>Best way to do this:</p>\n\n<p>Remove \'App Domain\' from \'Basic Info\'</p>\n\n<p>Set website\'s \'Site URL\' to : "http://localhost/" .</p>\n\n<p>That simple. </p>\n\n<p>(This only apply if you don\'t have a live system running in parallel to the test env. In that case get yourself another key.)</p>\n'}, {'answer_id': 25155137, 'author': 'user706001', 'author_id': 706001, 'author_profile': 'https://Stackoverflow.com/users/706001', 'pm_score': 0, 'selected': False, 'text': '<p>Another solution is NGROK</p>\n\n<p><a href="https://ngrok.com/" rel="nofollow">https://ngrok.com/</a></p>\n\n<p>It opens a public tunnel to your local app</p>\n\n<p>Example on my rails application by simply typing</p>\n\n<pre><code>./ngrok 3000\n</code></pre>\n\n<p>I get</p>\n\n<pre><code>http://630066fe.ngrok.com -&gt; 127.0.0.1:3000 \n</code></pre>\n'}]
['https://Stackoverflow.com/questions/39365', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2990/']