Facebook Api - Local Development, Testserver, Liveserver ... How?

I am working on a new website that uses the Facebook API to log in and several implementations of the Api chart.

Usually my workflow:

  • Localhost development
    Development using MAMP / XAMPP or similar software

  • Click on server -> test domain
    A team of people can check the changes for a few days to see if everything is working as planned.

  • Click on the server -> live domain
    Changes are available to the public.

Facebook uses the website URL in the application settings and for security reasons, it will redirect only to this url ... The problem is that I have localhost and 2 different domains. How can I do this job?

Of course, I could edit the hosts file, but this fixes it only for localhost. There is still no solution for testdomain.

Please tell me how this is possible! I'm getting more and more depressed with the Facebook API.

+4
source share
2 answers

I usually register a facebook application for each environment. (dev points to localhost, etc.) Didn't find a better way to do this either.

+3
source

why else test facebook api on localhost?

You can try heroku

This is the official facebook blog article.

Also see the document in heroics

It's free.

+1
source

Source: https://habr.com/ru/post/1380929/


All Articles