Compare commits
10 Commits
e3be4f5e6f
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 5843e9efa8 | |||
|
|
6ade388cd7 | ||
|
|
23e73aae19 | ||
|
|
23d73e0671 | ||
|
|
72b1c58b72 | ||
|
|
4173c3d96a | ||
|
|
8a8f77c4d5 | ||
|
|
08e3cdddb0 | ||
|
|
e1bd477753 | ||
|
|
174338af5d |
13
.config/dotnet-tools.json
Normal file
13
.config/dotnet-tools.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"isRoot": true,
|
||||||
|
"tools": {
|
||||||
|
"dotnet-ef": {
|
||||||
|
"version": "9.0.3",
|
||||||
|
"commands": [
|
||||||
|
"dotnet-ef"
|
||||||
|
],
|
||||||
|
"rollForward": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Version>1.0.0</Version>
|
<Version>1.0.0</Version>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
<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" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
13
Program.cs
13
Program.cs
@@ -9,6 +9,14 @@ 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" : "";
|
||||||
@@ -24,10 +32,7 @@ try
|
|||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
|
|
||||||
// Use Ocelot middleware in an appropriate way
|
// Use Ocelot middleware in an appropriate way
|
||||||
app.UseEndpoints(endpoints =>
|
app.MapControllers();
|
||||||
{
|
|
||||||
endpoints.MapControllers();
|
|
||||||
});
|
|
||||||
|
|
||||||
app.UseOcelot().Wait();
|
app.UseOcelot().Wait();
|
||||||
|
|
||||||
|
|||||||
22
Properties/PublishProfiles/IISProfileNet9Win64.pubxml
Normal file
22
Properties/PublishProfiles/IISProfileNet9Win64.pubxml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?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\WorkFlow\\.zip</DesktopBuildPackageLocation>
|
||||||
|
<PackageAsSingleFile>true</PackageAsSingleFile>
|
||||||
|
<DeployIisAppPath>Gateway</DeployIisAppPath>
|
||||||
|
<_TargetId>IISWebDeployPackage</_TargetId>
|
||||||
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
|
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||||
|
<SelfContained>false</SelfContained>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
45
ocelot.json
45
ocelot.json
@@ -1,19 +1,5 @@
|
|||||||
{
|
{
|
||||||
"Routes": [
|
"Routes": [
|
||||||
{
|
|
||||||
"DownstreamPathTemplate": "/swagger/{route}",
|
|
||||||
"DownstreamScheme": "http",
|
|
||||||
"DownstreamHostAndPorts": [
|
|
||||||
{
|
|
||||||
"Host": "localhost",
|
|
||||||
"Port": 9090
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"UpstreamPathTemplate": "/swagger/auth/{route}",
|
|
||||||
"UpstreamHttpMethod": [
|
|
||||||
"Get"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"DownstreamPathTemplate": "/swagger/{route}",
|
"DownstreamPathTemplate": "/swagger/{route}",
|
||||||
"DownstreamScheme": "http",
|
"DownstreamScheme": "http",
|
||||||
@@ -29,22 +15,33 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"DownstreamPathTemplate": "/api/Auth/{route}",
|
"DownstreamPathTemplate": "/swagger/{route}",
|
||||||
"DownstreamScheme": "http",
|
"DownstreamScheme": "http",
|
||||||
"DownstreamHostAndPorts": [
|
"DownstreamHostAndPorts": [
|
||||||
{
|
{
|
||||||
"Host": "localhost",
|
"Host": "localhost",
|
||||||
"Port": 8088
|
"Port": 9090
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"UpstreamPathTemplate": "/api/Auth/{route}",
|
"UpstreamPathTemplate": "/swagger/auth/{route}",
|
||||||
"UpstreamHttpMethod": [
|
"UpstreamHttpMethod": [
|
||||||
"Get",
|
"Get"
|
||||||
"Post"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"DownstreamPathTemplate": "/api/Auth/login/{id}",
|
"DownstreamPathTemplate": "/api/Auth/work-flow?cookie=false",
|
||||||
|
"DownstreamScheme": "http",
|
||||||
|
"DownstreamHostAndPorts": [
|
||||||
|
{
|
||||||
|
"Host": "localhost",
|
||||||
|
"Port": 9090
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"UpstreamPathTemplate": "/api/Auth",
|
||||||
|
"UpstreamHttpMethod": [ "Post" ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"DownstreamPathTemplate": "/api/Auth/check",
|
||||||
"DownstreamScheme": "http",
|
"DownstreamScheme": "http",
|
||||||
"DownstreamHostAndPorts": [
|
"DownstreamHostAndPorts": [
|
||||||
{
|
{
|
||||||
@@ -52,10 +49,8 @@
|
|||||||
"Port": 8088
|
"Port": 8088
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"UpstreamPathTemplate": "/api/Auth/login/{id}",
|
"UpstreamPathTemplate": "/api/Auth/check",
|
||||||
"UpstreamHttpMethod": [
|
"UpstreamHttpMethod": [ "Post" ]
|
||||||
"Post"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"DownstreamPathTemplate": "/api/{route}",
|
"DownstreamPathTemplate": "/api/{route}",
|
||||||
@@ -91,6 +86,6 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"GlobalConfiguration": {
|
"GlobalConfiguration": {
|
||||||
"BaseUrl": "https://localhost:7052"
|
"BaseUrl": "https://localhost:8443"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user