{"action":"created","issue":{"url":"https://api.github.com/repos/theiterators/reactive-microservices/issues/10","labels_url":"https://api.github.com/repos/theiterators/reactive-microservices/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/theiterators/reactive-microservices/issues/10/comments","events_url":"https://api.github.com/repos/theiterators/reactive-microservices/issues/10/events","html_url":"https://github.com/theiterators/reactive-microservices/issues/10","id":103850480,"number":10,"title":"Is there API gateway here?","user":{"login":"Ciantic","id":64731,"avatar_url":"https://avatars.githubusercontent.com/u/64731?v=3","gravatar_id":"","url":"https://api.github.com/users/Ciantic","html_url":"https://github.com/Ciantic","followers_url":"https://api.github.com/users/Ciantic/followers","following_url":"https://api.github.com/users/Ciantic/following{/other_user}","gists_url":"https://api.github.com/users/Ciantic/gists{/gist_id}","starred_url":"https://api.github.com/users/Ciantic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ciantic/subscriptions","organizations_url":"https://api.github.com/users/Ciantic/orgs","repos_url":"https://api.github.com/users/Ciantic/repos","events_url":"https://api.github.com/users/Ciantic/events{/privacy}","received_events_url":"https://api.github.com/users/Ciantic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-08-29T12:57:49Z","updated_at":"2015-09-01T16:38:50Z","closed_at":null,"body":"I'm trying to figure out best way to setup microservices and API for single-page frontend application.\r\n\r\nOf course there are many ways to do it, but is there API gateway in this project? Your diagram: http://www.typesafe.com/activator/template/reactive-microservices/tutorial/arch.png suggests there is not a API gateway.\r\n\r\nDo you see it as a requirement? I've found it in here: http://www.infoq.com/articles/seven-uservices-antipatterns here is the image: http://cdn.infoq.com/statics_s1_20150819-0313/resource/articles/seven-uservices-antipatterns/en/resources/fig4.jpg\r\n\r\nAlso someone has done a play + microservices template with a similar image: https://github.com/knoldus/playing-microservices of API gateway, however, I don't think that example works, all of the services are stubs that does not do anything.\r\n\r\nYour template of microservices seems most comprehensive so you may have a good reason to skip API gateway?\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/theiterators/reactive-microservices/issues/comments/136784942","html_url":"https://github.com/theiterators/reactive-microservices/issues/10#issuecomment-136784942","issue_url":"https://api.github.com/repos/theiterators/reactive-microservices/issues/10","id":136784942,"user":{"login":"Ciantic","id":64731,"avatar_url":"https://avatars.githubusercontent.com/u/64731?v=3","gravatar_id":"","url":"https://api.github.com/users/Ciantic","html_url":"https://github.com/Ciantic","followers_url":"https://api.github.com/users/Ciantic/followers","following_url":"https://api.github.com/users/Ciantic/following{/other_user}","gists_url":"https://api.github.com/users/Ciantic/gists{/gist_id}","starred_url":"https://api.github.com/users/Ciantic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ciantic/subscriptions","organizations_url":"https://api.github.com/users/Ciantic/orgs","repos_url":"https://api.github.com/users/Ciantic/repos","events_url":"https://api.github.com/users/Ciantic/events{/privacy}","received_events_url":"https://api.github.com/users/Ciantic/received_events","type":"User","site_admin":false},"created_at":"2015-09-01T16:38:49Z","updated_at":"2015-09-01T16:38:49Z","body":"I think the API gateway needs to be a own Play Framework application, that e.g. defines the routes and handles authentication like visioned here: http://nordicapis.com/how-to-control-user-identity-within-microservices/  by Jacob Ideskog (video: https://www.youtube.com/watch?v=BdKmZ7mPNns ). \r\n\r\nIt's a long one but the gist of it is that you must have a API gateway which takes from a user ID reference, and then gets corresponding identity JWT and passes it to microservices.\r\n\r\nRedirects was a bad term, I only meant same thing as in above nginx example but with Play, e.g.\r\n\r\n(Pseudo code route file)\r\n```\r\nGET,POST   /user/*                     SomehowPassTheseToUserMicroservice\r\nGET,POST   /billing/*                     SomehowPassTheseToBillingMicroservice\r\n```\r\n\r\nThen I could have in user service a clean route file such as \r\n\r\n```\r\nPOST   /signUp                     AuthController.signUp\r\nGET    /loginSocial/:provider      AuthController.loginSocial(provider)\r\nPOST   /loginSocial/:provider     AuthController.loginSocial(provider)\r\n...\r\n```\r\n\r\nbut when accessed from API gateway the URL's would be \"/user/signUp\", ... prefixed with \"user\""}}