Compare commits
9 Commits
5c4dec8e7c
...
feat/user-
| Author | SHA1 | Date | |
|---|---|---|---|
| f60bb79920 | |||
| d113d4fcdd | |||
| 59963d7d4c | |||
| 5843e9efa8 | |||
|
|
6ade388cd7 | ||
|
|
23e73aae19 | ||
|
|
23d73e0671 | ||
|
|
72b1c58b72 | ||
|
|
4173c3d96a |
@@ -1,4 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
@@ -13,7 +13,8 @@
|
|||||||
<PackageReference Include="NLog" Version="5.4.0" />
|
<PackageReference Include="NLog" Version="5.4.0" />
|
||||||
<PackageReference Include="NLog.Extensions.Logging" Version="5.4.0" />
|
<PackageReference Include="NLog.Extensions.Logging" Version="5.4.0" />
|
||||||
<PackageReference Include="NLog.Web.AspNetCore" Version="5.4.0" />
|
<PackageReference Include="NLog.Web.AspNetCore" Version="5.4.0" />
|
||||||
<PackageReference Include="Ocelot" Version="22.0.1" />
|
<PackageReference Include="Ocelot" Version="23.4.3" />
|
||||||
|
<PackageReference Include="Ocelot.Cache.CacheManager" Version="23.4.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
13
Program.cs
13
Program.cs
@@ -2,6 +2,7 @@ using NLog;
|
|||||||
using NLog.Web;
|
using NLog.Web;
|
||||||
using Ocelot.DependencyInjection;
|
using Ocelot.DependencyInjection;
|
||||||
using Ocelot.Middleware;
|
using Ocelot.Middleware;
|
||||||
|
using Ocelot.Cache.CacheManager;
|
||||||
|
|
||||||
var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger();
|
var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger();
|
||||||
logger.Info("Logging initialized.");
|
logger.Info("Logging initialized.");
|
||||||
@@ -9,13 +10,23 @@ logger.Info("Logging initialized.");
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
|
builder.Logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace);
|
||||||
|
|
||||||
|
if (!builder.Environment.IsDevelopment())
|
||||||
|
{
|
||||||
|
builder.Logging.ClearProviders();
|
||||||
|
builder.Host.UseNLog();
|
||||||
|
}
|
||||||
|
|
||||||
// Make sure to add the Ocelot configuration file
|
// Make sure to add the Ocelot configuration file
|
||||||
var suffix = builder.Environment.IsDevelopment() ? ".Development" : "";
|
var suffix = builder.Environment.IsDevelopment() ? ".Development" : "";
|
||||||
builder.Configuration.AddJsonFile($"ocelot{suffix}.json");
|
builder.Configuration.AddJsonFile($"ocelot{suffix}.json");
|
||||||
|
|
||||||
// Add Ocelot services
|
// Add Ocelot services
|
||||||
builder.Services.AddOcelot();
|
builder.Services
|
||||||
|
.AddOcelot()
|
||||||
|
.AddCacheManager(x => x.WithDictionaryHandle());
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
|
||||||
-->
|
|
||||||
<Project>
|
|
||||||
<PropertyGroup>
|
|
||||||
<WebPublishMethod>Package</WebPublishMethod>
|
|
||||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
|
||||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
|
||||||
<SiteUrlToLaunchAfterPublish />
|
|
||||||
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
|
||||||
<ExcludeApp_Data>false</ExcludeApp_Data>
|
|
||||||
<ProjectGuid>329f45bf-4c79-4a7b-9086-d6205617aa42</ProjectGuid>
|
|
||||||
<DesktopBuildPackageLocation>P:\Install .Net\0 DD - Smart UP\Gateway\UserManager\$(Version)\$(Version).zip</DesktopBuildPackageLocation>
|
|
||||||
<PackageAsSingleFile>true</PackageAsSingleFile>
|
|
||||||
<DeployIisAppPath>Gateway</DeployIisAppPath>
|
|
||||||
<_TargetId>IISWebDeployPackage</_TargetId>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -16,11 +16,11 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"DownstreamPathTemplate": "/swagger/auth/{route}",
|
"DownstreamPathTemplate": "/swagger/auth/{route}",
|
||||||
"DownstreamScheme": "https",
|
"DownstreamScheme": "http",
|
||||||
"DownstreamHostAndPorts": [
|
"DownstreamHostAndPorts": [
|
||||||
{
|
{
|
||||||
"Host": "localhost",
|
"Host": "172.24.12.39",
|
||||||
"Port": 7192
|
"Port": 9090
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"UpstreamPathTemplate": "/swagger/auth/{route}",
|
"UpstreamPathTemplate": "/swagger/auth/{route}",
|
||||||
@@ -30,11 +30,11 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"DownstreamPathTemplate": "/api/Auth/user-manager?cookie=true",
|
"DownstreamPathTemplate": "/api/Auth/user-manager?cookie=true",
|
||||||
"DownstreamScheme": "https",
|
"DownstreamScheme": "http",
|
||||||
"DownstreamHostAndPorts": [
|
"DownstreamHostAndPorts": [
|
||||||
{
|
{
|
||||||
"Host": "localhost",
|
"Host": "172.24.12.39",
|
||||||
"Port": 7192
|
"Port": 9090
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"UpstreamPathTemplate": "/api/Auth/login",
|
"UpstreamPathTemplate": "/api/Auth/login",
|
||||||
|
|||||||
Reference in New Issue
Block a user