weidazhao / Hosting

Hosting prototype
170 stars 35 forks source link

How to avoid url prefix for gateway service #24

Closed rmja closed 8 years ago

rmja commented 8 years ago

The services that I have registered in my application all gets to run with a path base like this: sf-8ac11d06a1784684990a75b74dbceab5. This is all fine for internal communication between the services, but how to avoid this for the gateway service, running on a particular port on all nodes?

weidazhao commented 8 years ago

The url prefix gets added when you add 'services.AddServiceFabricService()' in Startup.ConfigureServices(). Adding url prefix is necessary when multiple service instances exposing endpoints are hosted in the same process to share the same port.

For gateway service, check out https://github.com/weidazhao/Hosting/tree/master/Gateway, where 'services.AddServiceFabricService()' is not added in Startup.ConfigureServices().

rmja commented 8 years ago

Ahh, that is where the gateway differs. Thanks!