title: Separate back-end and front-end apps on same domain?
body: <p>We are building a fully RESTful back-end with the Play Framework. We are also building a separate web front-end with a different technology stack that will call the RESTful API.</p>
  <p>How do we deploy both apps so they have the same domain name, with some URLs used for the backend API and some for the front-end views?</p>
  <p>For example, visiting <code>MyDomain.example</code> means the front-end displays the home page, but sending a GET to <code>MyDomain.example/product/24</code> means the back-end returns a JSON object with the product information. A further possibility is if a web browser views <code>MyDomain.example/product/24</code>, then the front-end displays an HTML page, and that webpage was built from a back-end call to the same URL.</p>
  <p>Finally, do we need two dedicated servers for this? Or can the front-end and back-end be deployed on the same server (e.g. OpenShift, Heroku)</p>