Skip to content

Commit

Permalink
Change object IWebHostEnvironment for new IHostEnvironment of net core (
Browse files Browse the repository at this point in the history
#111)

* * Fix in the paths when swagger servers are overwriten, it is optional to use

* * added Server of swagger for configuration

* * Revert this file

* * Modify comment

* Typo changes

* * Added documentation of change
* Revert default value of serverOverride
* Added .RemoveSlashFromEnd(); in serverOverride

* * Added Multifile configuration ocelot and swagger

* * blank line removed

* * Remove line of file not used

* * Added comments

* Remove line not used

* *fixed test and new documentation on the new extension

* Remove ocelot.json from demo

* Fix demo

* Documentation

* typo

* IsNullOrEmpty

* * Change object IWebHostEnvironment for a object IHostEnvironment new of net core

Co-authored-by: David Jiménez <[email protected]>
Co-authored-by: Burgyn <[email protected]>
  • Loading branch information
3 people authored Jun 18, 2020
1 parent b9ba43d commit b5e4085
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions demo/ApiGateway/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using MMLib.SwaggerForOcelot.DependencyInjection;

namespace ApiGateway
Expand All @@ -12,8 +13,8 @@ public static void Main(string[] args)
CreateWebHostBuilder(args).Build().Run();
}

public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
public static IHostBuilder CreateWebHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureAppConfiguration((hostingContext, config) =>
{
config
Expand All @@ -25,6 +26,6 @@ public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
.AddOcelotWithSwaggerSupport(folder: "Configuration")
.AddEnvironmentVariables();
})
.UseStartup<Startup>();
.ConfigureWebHostDefaults(webBuilder => webBuilder.UseStartup<Startup>());
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Kros.Extensions;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using MMLib.SwaggerForOcelot.Configuration;
using Newtonsoft.Json;
using System;
Expand Down Expand Up @@ -28,7 +29,7 @@ public static class ConfigurationBuilderExtensions
/// <returns>a Object IConfigurationBuilder</returns>
public static IConfigurationBuilder AddOcelotWithSwaggerSupport(
this IConfigurationBuilder builder,
IWebHostEnvironment environment = null,
IHostEnvironment environment = null,
string folder = "/",
string fileOfSwaggerEndPoints = SwaggerForOcelotFileOptions.SwaggerEndPointsConfigFile)
{
Expand Down

0 comments on commit b5e4085

Please sign in to comment.