-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add StyleCop.Analyzers package * Fix SA0001: XML comment analysis is disabled due to project configuration * Fix SA1609: Property documentation should have value * Fix CS1591: Missing XML comment for publicly visible type or member {xyz} * Fix SA1101: Prefix local calls with this * Fix SA1413: The last statement in a multi-line C# initializer or list is missing a trailing comma. * Fix SA1135: A using directive is not qualified. * Fix compiler errors * Fix SA1651: Do not use placeholder elements * Fix compiling error * Fix SA1113: Comma should be on the same line as previous parameter * Fix SA1116: The parameters should begin on the line after the declaration, whenever the parameter span across multiple lines * Fix SA1137: Elements should have the same indentation * Fix SA1200: Using directive should appear within a namespace declaration * Fix SA1316: Tuple element names should use correct casing * Fix SA1503: Braces should not be omitted * Fix SA1505: An opening brace should not be followed by a blank line * Fix SA1507: Code should not contain multiple blank lines in a row * Fix SA1508: A closing brace should not be preceded by a blank line * Fix SA1512, SA1515 * Fix SA1513: Closing brace should be followed by blank line * Fix SA1400: Element 'OpenTracingTracer' should declare an access modifier * Fix SA1515: Single-line comment should be preceded by blank line * Fix SA1518: File is required to end with a single newline character * Add StyleCop * Fix SA1633: A C# code file is missing a standard file header. * Disable SA1602: An item within a C# enumeration is missing an Xml documentation header. * Fix SA1600: Elements should be documented * Fix SA1604: Element documentation should have summary * Fix SA1618: The documentation for type parameter 'T' is missing * Fix SA1629: Documentation text should end with a period. * Fix SA1649: File name should match first type name * Fix SA1600: Elements should be documented * Upgrade K8s sample to ASP.NET 7. Rename project to Ocelot.Samples.OcelotKube.DownstreamService * Upgrade K8s sample to ASP.NET 7. Rename project to Ocelot.Samples.OcelotKube.ApiGateway * Fix CS0169: The field 'xxx' is never used * Fix CS0219: The variable 'baseUrl' is assigned but its value is never used * Fix CS0414: The field 'xxx' is assigned but its value is never used * Fix CS1570: XML comment has badly formed XML * Fix CS0649: Field 'xxx' is never assigned to, and will always have its default value null * Fix CS0618: 'member' is obsolete: 'text' * Fix NU1504: Duplicate 'PackageReference' items found: Microsoft.Data.SQLite 7.0.4, Microsoft.Data.SQLite 7.0.5 * Upgrade sample to ASP.NET 7 * Fix NU5048: The 'PackageIconUrl'/'iconUrl' element is deprecated. Consider using the 'PackageIcon'/'icon' element instead. Learn more at https://aka.ms/deprecateIconUrl * Rewrite a RequestDelegate object definition * Fix CS0618: 'member' is obsolete: 'text' * Fix CA1816: Change Dispose() to call GC.SuppressFinalize(object). This will prevent derived types that introduce a finalizer from needing to re-implement 'IDisposable' to call it. * Fix CA1822: Member 'GivenThereIsAConfiguration' does not access instance data and can be marked as static * Fix CA1837: Use 'Environment.ProcessId' instead of 'Process.GetCurrentProcess().Id' * Fix CA2211: Non-constant fields should not be visible. Convert to property. * Fix IDE0060: Remove unused parameter 'path' if it is not part of a shipped public API * Fix CA1816: Change ConsulWebSocketTests.Dispose() to call GC.SuppressFinalize(object). * Fix IDE1006: Naming rule violation: These words must begin with upper case characters * Fix IDE1006: Naming rule violation: These words must begin with upper case characters: AcceptanceTests\WebSocketTests * Fix last issues * Upgrade basic sample to ASP.NET 7
- Loading branch information
Showing
444 changed files
with
5,444 additions
and
5,439 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,40 @@ | ||
using System.IO; | ||
|
||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.AspNetCore.Hosting; | ||
using Microsoft.Extensions.Configuration; | ||
|
||
using Ocelot.DependencyInjection; | ||
using Ocelot.Middleware; | ||
using Microsoft.Extensions.Hosting; | ||
using Microsoft.Extensions.Logging; | ||
using System.IO; | ||
|
||
namespace Ocelot.Samples.OcelotBasic.ApiGateway; | ||
|
||
namespace OcelotBasic | ||
public class Program | ||
{ | ||
public class Program | ||
public static void Main(string[] args) | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
new WebHostBuilder() | ||
.UseKestrel() | ||
.UseContentRoot(Directory.GetCurrentDirectory()) | ||
.ConfigureAppConfiguration((hostingContext, config) => | ||
{ | ||
config | ||
.SetBasePath(hostingContext.HostingEnvironment.ContentRootPath) | ||
.AddJsonFile("appsettings.json", true, true) | ||
.AddJsonFile($"appsettings.{hostingContext.HostingEnvironment.EnvironmentName}.json", true, true) | ||
.AddJsonFile("ocelot.json") | ||
.AddEnvironmentVariables(); | ||
}) | ||
.ConfigureServices(s => | ||
{ | ||
s.AddOcelot(); | ||
}) | ||
.ConfigureLogging((hostingContext, logging) => | ||
{ | ||
//add your logging | ||
}) | ||
.UseIISIntegration() | ||
.Configure(app => | ||
{ | ||
app.UseOcelot().Wait(); | ||
}) | ||
.Build() | ||
.Run(); | ||
} | ||
new WebHostBuilder() | ||
.UseKestrel() | ||
.UseContentRoot(Directory.GetCurrentDirectory()) | ||
.ConfigureAppConfiguration((hostingContext, config) => | ||
{ | ||
config | ||
.SetBasePath(hostingContext.HostingEnvironment.ContentRootPath) | ||
.AddJsonFile("appsettings.json", true, true) | ||
.AddJsonFile($"appsettings.{hostingContext.HostingEnvironment.EnvironmentName}.json", true, true) | ||
.AddJsonFile("ocelot.json") | ||
.AddEnvironmentVariables(); | ||
}) | ||
.ConfigureLogging((hostingContext, logging) => | ||
{ | ||
if (hostingContext.HostingEnvironment.IsDevelopment()) | ||
{ | ||
logging.ClearProviders(); | ||
logging.AddConsole(); | ||
} | ||
//add your logging | ||
}) | ||
.UseIISIntegration() | ||
.UseStartup<Startup>() | ||
.Build() | ||
.Run(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.AspNetCore.Hosting; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Hosting; | ||
using Ocelot.DependencyInjection; | ||
using Ocelot.Middleware; | ||
|
||
namespace Ocelot.Samples.OcelotBasic.ApiGateway; | ||
|
||
public class Startup | ||
{ | ||
// This method gets called by the runtime. Use this method to add services to the container. | ||
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 | ||
public void ConfigureServices(IServiceCollection services) | ||
{ | ||
services.AddOcelot(); | ||
services.AddLogging(); | ||
} | ||
|
||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. | ||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) | ||
{ | ||
if (env.IsDevelopment()) | ||
{ | ||
app.UseDeveloperExceptionPage(); | ||
} | ||
|
||
app.UseOcelot().Wait(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft": "Warning", | ||
"Microsoft.Hosting.Lifetime": "Information" | ||
"Default": "Debug", | ||
"Microsoft": "Information", | ||
"Microsoft.AspNetCore": "Information", | ||
"Microsoft.Hosting.Lifetime": "Information", | ||
"System": "Information" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,4 @@ | |
"GlobalConfiguration": { | ||
"BaseUrl": "https://localhost:5000" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
FROM mcr.microsoft.com/dotnet/core/aspnet:2.1-stretch-slim AS base | ||
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base | ||
WORKDIR /app | ||
EXPOSE 80 | ||
EXPOSE 443 | ||
|
||
FROM mcr.microsoft.com/dotnet/core/sdk:2.1-stretch AS build | ||
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build | ||
WORKDIR /src | ||
COPY ["ApiGateway/ApiGateway.csproj", "ApiGateway/"] | ||
RUN dotnet restore "ApiGateway/ApiGateway.csproj" | ||
COPY ["ApiGateway/Ocelot.Samples.OcelotKube.ApiGateway.csproj", "ApiGateway/"] | ||
RUN dotnet restore "ApiGateway/Ocelot.Samples.OcelotKube.ApiGateway.csproj" | ||
COPY . . | ||
WORKDIR "/src/ApiGateway" | ||
RUN dotnet build "ApiGateway.csproj" -c Release -o /app | ||
RUN dotnet build "Ocelot.Samples.OcelotKube.ApiGateway.csproj" -c Release -o /app/build | ||
|
||
FROM build AS publish | ||
RUN dotnet publish "ApiGateway.csproj" -c Release -o /app | ||
RUN dotnet publish "Ocelot.Samples.OcelotKube.ApiGateway.csproj" -c Release -o /app/publish /p:UseAppHost=false | ||
|
||
FROM base AS final | ||
WORKDIR /app | ||
COPY --from=publish /app . | ||
ENTRYPOINT ["dotnet", "ApiGateway.dll"] | ||
COPY --from=publish /app/publish . | ||
ENTRYPOINT ["dotnet", "Ocelot.Samples.OcelotKube.ApiGateway.dll"] |
33 changes: 18 additions & 15 deletions
33
...s/OcelotKube/ApiGateway/ApiGateway.csproj → ...elot.Samples.OcelotKube.ApiGateway.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel> | ||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" /> | ||
<PackageReference Include="Ocelot" Version="18.0.0" /> | ||
<PackageReference Include="Ocelot.Provider.Kubernetes" Version="18.0.0" /> | ||
</ItemGroup> | ||
|
||
</Project> | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel> | ||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.18.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\..\src\Ocelot.Provider.Kubernetes\Ocelot.Provider.Kubernetes.csproj" /> | ||
<ProjectReference Include="..\..\..\src\Ocelot\Ocelot.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Oops, something went wrong.