-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #960 from dongfo/master
add config of Gateway from yarp.json.
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
...l.ApiGateway/src/LINGYUN.MicroService.Internal.Gateway/AbpHostingHostBuilderExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.Hosting; | ||
|
||
namespace LINGYUN.MicroService.Internal.Gateway; | ||
|
||
public static class AbpHostingHostBuilderExtensions | ||
{ | ||
public const string AppYarpJsonPath = "yarp.json"; | ||
public static IHostBuilder AddYarpJson( | ||
this IHostBuilder hostBuilder, | ||
bool optional = true, | ||
bool reloadOnChange = true, | ||
string path = AppYarpJsonPath) | ||
{ | ||
return hostBuilder.ConfigureAppConfiguration((_, builder) => | ||
{ | ||
builder.AddJsonFile( | ||
path: AppYarpJsonPath, | ||
optional: optional, | ||
reloadOnChange: reloadOnChange | ||
); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters