AdamNYC
AdamNYC

Reputation: 20415

Specify two site URLs for Facebook API

I am using Facebook Graph API. To set it up, I need to fill out the App Setting on developer.facebook.com.

I need to specify two URLs, one for local testing (localhost:3000), and another for live app. How should I do this?

Thank you.

Upvotes: 1

Views: 207

Answers (1)

C3roe
C3roe

Reputation: 96206

I need to specify two URLs, one for local testing (localhost:3000), and another for live app. How should I do this?

That’s not possible – at least not if you want to use Facebook login.

You have two options:

  • Set up a second app for testing. This works quite well, as long as it does not come to things like Open Graph actions which need to be approved by FB and are tied to the app they were are proved for.

  • Set your local test environment up to be accessible from your local computer by the domain name used for the live site. F.e. when using Apache as webserver, by setting up a corresponding VirtualHost and manipulate your local DNS into resolving the domain to your local IP (via hosts file under windows). Also since your live app will most likely use port :80, you should set up your local server to answer to HTTP requests on that port.

Upvotes: 1

Related Questions