mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-19 16:48:15 +08:00
#296 renamed configuration.json to ocelot.json in preparation
This commit is contained in:
@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using Ocelot.Configuration.File;
|
||||
using Ocelot.Configuration.Repository;
|
||||
using Ocelot.Responses;
|
||||
@ -10,7 +7,7 @@ namespace Ocelot.Configuration.Provider
|
||||
{
|
||||
public class FileConfigurationProvider : IFileConfigurationProvider
|
||||
{
|
||||
private IFileConfigurationRepository _repo;
|
||||
private readonly IFileConfigurationRepository _repo;
|
||||
|
||||
public FileConfigurationProvider(IFileConfigurationRepository repo)
|
||||
{
|
||||
@ -23,4 +20,4 @@ namespace Ocelot.Configuration.Provider
|
||||
return new OkResponse<FileConfiguration>(fileConfig.Data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,10 +12,12 @@ namespace Ocelot.Configuration.Repository
|
||||
private readonly string _configFilePath;
|
||||
|
||||
private static readonly object _lock = new object();
|
||||
|
||||
|
||||
private const string ConfigurationFileName = "ocelot";
|
||||
|
||||
public FileConfigurationRepository(IHostingEnvironment hostingEnvironment)
|
||||
{
|
||||
_configFilePath = $"{AppContext.BaseDirectory}/configuration{(string.IsNullOrEmpty(hostingEnvironment.EnvironmentName) ? string.Empty : ".")}{hostingEnvironment.EnvironmentName}.json";
|
||||
_configFilePath = $"{AppContext.BaseDirectory}/{ConfigurationFileName}{(string.IsNullOrEmpty(hostingEnvironment.EnvironmentName) ? string.Empty : ".")}{hostingEnvironment.EnvironmentName}.json";
|
||||
}
|
||||
|
||||
public Task<Response<FileConfiguration>> Get()
|
||||
|
@ -7,7 +7,7 @@ namespace Ocelot.DependencyInjection
|
||||
{
|
||||
public static class ConfigurationBuilderExtensions
|
||||
{
|
||||
[Obsolete("Please set BaseUrl in configuration.json GlobalConfiguration.BaseUrl")]
|
||||
[Obsolete("Please set BaseUrl in ocelot.json GlobalConfiguration.BaseUrl")]
|
||||
public static IConfigurationBuilder AddOcelotBaseUrl(this IConfigurationBuilder builder, string baseUrl)
|
||||
{
|
||||
var memorySource = new MemoryConfigurationSource();
|
||||
|
Reference in New Issue
Block a user