title: Should I place SPA and RESTful API in different servers?
body: <p>I'm developing a Single Page Application (SPA) and a RESTful API to serve resources to it.</p>
  
  <p>Since I'm going to develop mobile applications, and even open the service to third parties in the future I thought of placing the SPA in one server and the REST API in other. I think that way I should be able to scale the service easily.</p>
  
  <p>Should I create the web app (SPA+Resource server) in one place, or separate server is the right way to go?
  Should I use some token protocol to authenticate the SPA to the REST API to guarantee its authenticity?</p>
  
  <p>I read about OAuth, but it is very complex, and I don't no if it makes sense to my case, since I'm developing both ends. But it does guarantee the authenticity of the app (my SPA) and the user. Maybe OAuth is the solution?</p>
  
  <p>Thanks a lot for any help here!</p>