mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-23 13:02:51 +08:00

* initial commits around using any id servers * add your own id server for admin area * lots of refactoring, now instead of injecting IWebHostBuilder we just set the Ocelot base url as a configuration extension method..this means people can pass it in on the command line aswell as hardcode which is OK I guess, also can now use your own IdentityServer to authenticate admin area * updated docs for #231 * some tests that hopefully bump up coverage
22 lines
507 B
C#
22 lines
507 B
C#
using Microsoft.Extensions.Configuration;
|
|
|
|
namespace Ocelot.Middleware
|
|
{
|
|
public class BaseUrlFinder : IBaseUrlFinder
|
|
{
|
|
private readonly IConfiguration _config;
|
|
|
|
public BaseUrlFinder(IConfiguration config)
|
|
{
|
|
_config = config;
|
|
}
|
|
|
|
public string Find()
|
|
{
|
|
var baseUrl = _config.GetValue("BaseUrl", "");
|
|
|
|
return string.IsNullOrEmpty(baseUrl) ? "http://localhost:5000" : baseUrl;
|
|
}
|
|
}
|
|
}
|