Title: Should my server be on a different domain than my landing page?
Tags: ruby-on-rails;ssl;heroku
Question: I need to purchase a domain and hosting for my backend heroku rails server, so that I can implement SSL. (I could use heroku's SSL endpoint, but then I can't pin the certificate to my iOS app).
My question is... should I have my landing page and all my server side endpoints on the same domain?
For example... www.myexampledomain.com might be my landing page. Whereas www.myexampledomain.com/api/v1/things might be an endpoint returning json to my iOS client.
Should these be separate? Should I use subdomains for my json server returns? (I was hoping to use a single domain to save money on the SSL certificate)
Comment: I'm sure you can also use heroku with certificate pinning - have you tried it yet? I'm looking to do something similar.


Here is another answer: Until you're server huge amounts of traffic, there really isn't any harm on having them on the same server. Even then, there are other ways of dealing with the traffic requirements other than separating the front-facing website from the API.
The pattern you showed is very common, and you shouldn't have any huge issues with keeping them together.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 1, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2015:00:07/04/15', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<ruby-on-rails><ssl><heroku>', 'Title': 'Should my server be on a different domain than my landing page?', 'ViewCount': 90, 'id': 31222791, 'user_AboutMe': None, 'user_AccountId': 1817316.0, 'user_DisplayName': 'chris P', 'user_Reputation': 6201.0, 'user_Views': 259.0, 'user_id': 1652166.0}}