Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/WebApi/GamingApi.WebApi.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisMode>Default</AnalysisMode>
<AssemblyName>Yld.GamingApi.WebApi</AssemblyName>
<RootNamespace>Yld.GamingApi.WebApi</RootNamespace>
</PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisMode>Default</AnalysisMode>
<AssemblyName>Yld.GamingApi.WebApi</AssemblyName>
<RootNamespace>Yld.GamingApi.WebApi</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>YldGamingApi.xml</DocumentationFile>
<NoWarn>1701;1702;1591</NoWarn>
Expand All @@ -16,6 +16,6 @@
<DocumentationFile>YldGamingApi.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.7.3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="10.2.3" />
</ItemGroup>
</Project>
23 changes: 10 additions & 13 deletions src/WebApi/Program.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
using Microsoft.AspNetCore;
using Yld.GamingApi.WebApi;

namespace Yld.GamingApi.WebApi;
var builder = WebApplication.CreateBuilder(args);

public static class Program
{
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}
// Add services
builder.Services.AddDefaultServices();

public static IWebHostBuilder CreateWebHostBuilder(string[] args)
{
return WebHost.CreateDefaultBuilder(args).UseStartup<Startup>();
}
}
var app = builder.Build();

// Configure middleware
app.UseDefaultAppConfig();

app.Run();
2 changes: 1 addition & 1 deletion src/WebApi/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:59613;http://localhost:59614"
"applicationUrl": "http://localhost:59614;https://localhost:59613"
}
}
}
15 changes: 0 additions & 15 deletions src/WebApi/Startup.cs

This file was deleted.

7 changes: 5 additions & 2 deletions src/WebApi/WebApiDefaultConfig.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Microsoft.AspNetCore.Rewrite;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi;
using Swashbuckle.AspNetCore.SwaggerUI;

namespace Yld.GamingApi.WebApi;
Expand Down Expand Up @@ -35,7 +35,10 @@ public static IApplicationBuilder UseDefaultAppConfig(this IApplicationBuilder a
c.DocExpansion(DocExpansion.List);
});

app.UseHttpsRedirection();
if (app.ApplicationServices.GetRequiredService<IHostEnvironment>().IsProduction())
{
app.UseHttpsRedirection();
}

app.UseRouting();

Expand Down
5 changes: 5 additions & 0 deletions src/WebApi/YldGamingApi.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.