Peak.Lib.Ocelot.Nacos
1.0.2
See the version list below for details.
dotnet add package Peak.Lib.Ocelot.Nacos --version 1.0.2
NuGet\Install-Package Peak.Lib.Ocelot.Nacos -Version 1.0.2
<PackageReference Include="Peak.Lib.Ocelot.Nacos" Version="1.0.2" />
paket add Peak.Lib.Ocelot.Nacos --version 1.0.2
#r "nuget: Peak.Lib.Ocelot.Nacos, 1.0.2"
// Install Peak.Lib.Ocelot.Nacos as a Cake Addin #addin nuget:?package=Peak.Lib.Ocelot.Nacos&version=1.0.2 // Install Peak.Lib.Ocelot.Nacos as a Cake Tool #tool nuget:?package=Peak.Lib.Ocelot.Nacos&version=1.0.2
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();
var app = builder.Build();
app.UseOcelot().Wait();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. 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. |
-
net6.0
- Microsoft.Extensions.Configuration.Abstractions (>= 6.0.0)
- nacos-sdk-csharp.AspNetCore (>= 1.3.4)
- Ocelot (>= 18.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.