Peak.Lib.Ocelot.Nacos
1.0.3
dotnet add package Peak.Lib.Ocelot.Nacos --version 1.0.3
NuGet\Install-Package Peak.Lib.Ocelot.Nacos -Version 1.0.3
<PackageReference Include="Peak.Lib.Ocelot.Nacos" Version="1.0.3" />
paket add Peak.Lib.Ocelot.Nacos --version 1.0.3
#r "nuget: Peak.Lib.Ocelot.Nacos, 1.0.3"
// Install Peak.Lib.Ocelot.Nacos as a Cake Addin #addin nuget:?package=Peak.Lib.Ocelot.Nacos&version=1.0.3 // Install Peak.Lib.Ocelot.Nacos as a Cake Tool #tool nuget:?package=Peak.Lib.Ocelot.Nacos&version=1.0.3
Ocelot Nacos网关
appsettings.json 配置文件
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"nacos": {
"ServerAddresses": [ "http://192.168.40.117:8848/" ],
"DefaultTimeOut": 15000,
"ListenInterval": 1000,
"ServiceName": "NacosGateway",
"GroupName": "atlantis-cloud",
"Namespace": "public",
"NamingUseRpc": false
},
"Routes": [
{
"UseServiceDiscovery": true,
"DownstreamPathTemplate": "/sovell/person/clientapi/{url}",
"DownstreamScheme": "http",
"ServiceName": "sovell-person-clientapi",
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"UpstreamPathTemplate": "/api/{url}",
"UpstreamHttpMethod": [ "Get", "Post" ],
"ReRoutesCaseSensitive": false,
"AuthenticationOptions": {
"AuthenticationProviderKey": null,
"AllowedScopes": []
},
"HttpHandlerOptions": {
"AllowAutoRedirect": false,
"UseCookieContainer": false,
"UseTracing": false,
"UseProxy": true
},
"DangerousAcceptAnyServerCertificateValidator": false,
"Timeout": 0
}
],
"GlobalConfiguration": {
"ServiceDiscoveryProvider": {
"Type": "Nacos"
}
}
}
程序引用:
Program.cs
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddOcelot().AddNacos();
或
builder.Services.AddOcelot().AddNacos(“https://127.0.0.1:8848/”);
var app = builder.Build();
app.UseOcelot().Wait();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net7.0
- Microsoft.Extensions.Configuration.Abstractions (>= 7.0.0)
- nacos-sdk-csharp.AspNetCore (>= 1.3.5)
- Ocelot (>= 19.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.