Mr T
Mr T

Reputation: 1000

Parse Server Custom Domain On Heroku

I have set up a Parse Server on Heroku, with an MLab MongoDB. Everything works fine, & when I visit https://myapp.herokuapp.com I see "Make sure to star the parse-server repo on GitHub!".

I can successfully perform API functions through my Postman Console, for example logging in via the following REST API call: https://myapp.herokuapp.com/parse/login?username=admin&password=password.

I can also perform other REST API POST, GET, etc. as you would expect.

I'm now trying to use my own domain "api.mydomain.net". In the Heroku App > Settings > Custom Domains, I have set domain to "api.mydomain.net" & "myapp.herokuapp.com" as the DNS target.

I've also added a CNAME record to the DNS pointing "api" to "myapp.herokuapp.com".

When I visit https://api.mydomain.net I see the "Make sure to star the parse-server repo on GitHub!" message confirming that the CNAME record works, however when I go to perform the same REST API Login call https://api.mydomain.net/parse/login?username=admin&password=password I get the response:

Could not get any response.

This seems to be like an error connecting to https://api.mydomain.net/parse/login?username=admin&password=password.

What am I missing?

Upvotes: 2

Views: 266

Answers (1)

Manuel
Manuel

Reputation: 15042

You are trying to securely connect to the Parse Server with https. So you have to add a TSL certificate for your Heroku app in the Heroku dashboard.

  1. Open Heroku app in Heroku dashboard
  2. Open Settings tab
  3. In section Domains and certificates click Configure SSL and choose Automatically configure using Automated Certificate Management.
  4. Click Add domain to add the domain from which the request should be forwarded, e.g. api.example.com.
  5. On your domain registrar's website set the CNAME for api.example.com to the domain in the Heroku app settings, e.g. api.example.com.herokudns.com
  6. Wait until the status of the domain in the Heroku dashboard is Done

Upvotes: 0

Related Questions