I am designing an ASP.NET Core based Web API, which needs to support multiple variants of my product, let's say based on a license or the variety which it was installed.
Instead of going for multiple services for each type of product, I thought of a single service which houses/hosts multiple Endpoints or URLs. I will make this configurable in the appsettings.json at the time of installation.
I am aware of the UseUrls on creating the WebHost, but can I bind the specific URL in a set of URLs to specific Controllers?
Code:
WebHost.CreateDefaultBuilder(args)
.UseUrls("http://localhost:5000;http://localhost:5001;https://localhost:5002")
Expect
https://localhost:5000/ --> Product1Controller
https://localhost:5001/ --> Product2Controller
https://localhost:5002/ --> Product2Controller
I am new to the ASP.NET Core, please help me if this is achievable or not. Thanks in advance.