Skip to content

Commit 96a3fd8

Browse files
author
Ray
committed
First step
1 parent 36ad6e1 commit 96a3fd8

File tree

499 files changed

+5325
-4310
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

499 files changed

+5325
-4310
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<PropertyGroup>
3-
<TargetFramework>net6.0</TargetFramework>
3+
<TargetFramework>net7.0</TargetFramework>
44
</PropertyGroup>
55
<ItemGroup>
66
<Folder Include="wwwroot\" />
77
</ItemGroup>
88
<ItemGroup>
9-
<PackageReference Include="Ocelot" Version="17.0.1" />
10-
<PackageReference Include="Ocelot.Administration" Version="17.0.1" />
9+
<PackageReference Include="Ocelot" Version="18.0.0" />
10+
<PackageReference Include="Ocelot.Administration" Version="18.0.0" />
1111

1212
</ItemGroup>
1313
</Project>

samples/AdministrationApi/Issue645.postman_collection.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
"id": "0f60e7b3-e4f1-4458-bbc4-fc4809e86b2d",
133133
"type": "text/javascript",
134134
"exec": [
135-
""
135+
string.Empty
136136
]
137137
}
138138
},
@@ -142,7 +142,7 @@
142142
"id": "1279a2cf-b771-4a86-9dfa-302b240fac62",
143143
"type": "text/javascript",
144144
"exec": [
145-
""
145+
string.Empty
146146
]
147147
}
148148
}

samples/AdministrationApi/Program.cs

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,48 @@
1-
using Microsoft.AspNetCore.Hosting;
1+
using System.IO;
2+
3+
using Microsoft.AspNetCore.Hosting;
24
using Microsoft.Extensions.Configuration;
35
using Microsoft.Extensions.Logging;
6+
47
using Ocelot.Administration;
58
using Ocelot.DependencyInjection;
69
using Ocelot.Middleware;
7-
using System.IO;
810

911
namespace AdministrationApi
1012
{
1113
public class Program
12-
{
13-
public static void Main(string[] args)
1414
{
15-
new WebHostBuilder()
16-
.UseKestrel()
17-
.UseUrls("http://localhost:5000")
18-
.UseContentRoot(Directory.GetCurrentDirectory())
19-
.ConfigureAppConfiguration((hostingContext, config) =>
20-
{
21-
config
22-
.SetBasePath(hostingContext.HostingEnvironment.ContentRootPath)
23-
.AddJsonFile("appsettings.json", true, true)
24-
.AddJsonFile($"appsettings.{hostingContext.HostingEnvironment.EnvironmentName}.json", true, true)
25-
.AddJsonFile("ocelot.json")
26-
.AddEnvironmentVariables();
27-
})
28-
.ConfigureServices(s => {
29-
s.AddOcelot()
30-
.AddAdministration("/administration", "secret");
31-
})
32-
.ConfigureLogging((hostingContext, logging) =>
33-
{
34-
logging.AddConsole();
35-
})
36-
.UseIISIntegration()
37-
.Configure(app =>
38-
{
39-
app.UseOcelot().Wait();
40-
})
41-
.Build()
42-
.Run();
15+
public static void Main(string[] args)
16+
{
17+
new WebHostBuilder()
18+
.UseKestrel()
19+
.UseUrls("http://localhost:5000")
20+
.UseContentRoot(Directory.GetCurrentDirectory())
21+
.ConfigureAppConfiguration((hostingContext, config) =>
22+
{
23+
config
24+
.SetBasePath(hostingContext.HostingEnvironment.ContentRootPath)
25+
.AddJsonFile("appsettings.json", true, true)
26+
.AddJsonFile($"appsettings.{hostingContext.HostingEnvironment.EnvironmentName}.json", true, true)
27+
.AddJsonFile("ocelot.json")
28+
.AddEnvironmentVariables();
29+
})
30+
.ConfigureServices(s =>
31+
{
32+
s.AddOcelot()
33+
.AddAdministration("/administration", "secret");
34+
})
35+
.ConfigureLogging((hostingContext, logging) =>
36+
{
37+
logging.AddConsole();
38+
})
39+
.UseIISIntegration()
40+
.Configure(app =>
41+
{
42+
app.UseOcelot().Wait();
43+
})
44+
.Build()
45+
.Run();
46+
}
4347
}
4448
}
45-
}

samples/OcelotBasic/OcelotBasic.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="ocelot" Version="17.0.1" />
8+
<PackageReference Include="ocelot" Version="18.0.0" />
99
</ItemGroup>
1010

1111
<ItemGroup>

samples/OcelotBasic/Program.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System.IO;
2+
23
using Microsoft.AspNetCore.Hosting;
34
using Microsoft.Extensions.Configuration;
4-
using Microsoft.Extensions.Hosting;
55
using Ocelot.DependencyInjection;
66
using Ocelot.Middleware;
77

@@ -23,7 +23,8 @@ public static void Main(string[] args)
2323
.AddJsonFile("ocelot.json")
2424
.AddEnvironmentVariables();
2525
})
26-
.ConfigureServices(s => {
26+
.ConfigureServices(s =>
27+
{
2728
s.AddOcelot();
2829
})
2930
.ConfigureLogging((hostingContext, logging) =>

samples/OcelotEureka/ApiGateway/ApiGateway.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
@@ -15,9 +15,9 @@
1515
</ItemGroup>
1616

1717
<ItemGroup>
18-
<PackageReference Include="Ocelot" Version="17.0.1" />
19-
<PackageReference Include="Ocelot.Provider.Eureka" Version="17.0.1" />
20-
<PackageReference Include="Ocelot.Provider.Polly" Version="17.0.1" />
18+
<PackageReference Include="Ocelot" Version="18.0.0" />
19+
<PackageReference Include="Ocelot.Provider.Eureka" Version="18.0.0" />
20+
<PackageReference Include="Ocelot.Provider.Polly" Version="18.0.0" />
2121
</ItemGroup>
2222

2323
</Project>

samples/OcelotEureka/ApiGateway/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace ApiGateway
66
using Microsoft.AspNetCore;
77
using Microsoft.AspNetCore.Hosting;
88
using Microsoft.Extensions.Configuration;
9+
910
using Ocelot.DependencyInjection;
1011
using Ocelot.Middleware;
1112

samples/OcelotEureka/DownstreamService/Controllers/CategoryController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Collections.Generic;
2+
23
using Microsoft.AspNetCore.Mvc;
34

45
namespace DownstreamService.Controllers

samples/OcelotEureka/DownstreamService/DownstreamService.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

samples/OcelotEureka/DownstreamService/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
23
using Microsoft.AspNetCore;
34
using Microsoft.AspNetCore.Hosting;
45

0 commit comments

Comments
 (0)