fix for new hosting

This commit is contained in:
Tomasi - Developing 2025-01-29 15:16:23 +01:00
parent 18ea1a1540
commit 3c19151def
3 changed files with 35 additions and 3 deletions

View File

@ -33,4 +33,8 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\PublishProfiles\" />
</ItemGroup>
</Project>

View File

@ -8,20 +8,24 @@ using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Serilog;
using Utilities.Classes;
Log.Logger = new LoggerConfiguration()
.WriteTo.Console()
.CreateBootstrapLogger();
try
{
Log.Information("Starting API . . . ");
Log.Information("Starting Player Manager API . . . ");
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSerilog(options =>
var logPath = Path.Combine(AppContext.BaseDirectory, "logs", "log-.txt");
builder.Host.UseSerilog((context, _, configuration) =>
{
options.ReadFrom.Configuration(builder.Configuration);
configuration.ReadFrom.Configuration(context.Configuration)
.WriteTo.File(logPath, rollingInterval: RollingInterval.Day, rollOnFileSizeLimit: true);
});
builder.Services.AddDatabase(builder.Configuration);
builder.Services.AddApplication();

24
Api/Web.config Normal file
View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<!-- Deactivate WebDAV to enable PUT/DELETE -->
<modules>
<remove name="WebDAVModule" />
</modules>
<handlers>
<remove name="WebDAV" />
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<!-- Allows only POST, PUT and DELETE -->
<security>
<requestFiltering>
<verbs applyToWebDAV="false">
<add verb="POST" allowed="true" />
<add verb="PUT" allowed="true" />
<add verb="DELETE" allowed="true" />
</verbs>
</requestFiltering>
</security>
</system.webServer>
</configuration>