mirror of
https://github.com/raphaeIl/Novaria.git
synced 2025-12-12 22:44:35 +01:00
46 lines
1.2 KiB
C#
46 lines
1.2 KiB
C#
using System.Reflection;
|
|
using System.Security.Cryptography;
|
|
using Google.Protobuf;
|
|
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
|
using Pb;
|
|
using Serilog;
|
|
|
|
namespace Novaria.SDKServer
|
|
{
|
|
public class SDKServer
|
|
{
|
|
public static void Main(string[] args)
|
|
{
|
|
Log.Information("Starting SDK Server...");
|
|
try
|
|
{
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
builder.Services.Configure<KestrelServerOptions>(op =>
|
|
op.AllowSynchronousIO = true
|
|
);
|
|
builder.Host.UseSerilog();
|
|
|
|
builder.Services.AddControllers();
|
|
builder.Services.AddControllers().AddApplicationPart(Assembly.GetAssembly(typeof(SDKServer)));
|
|
|
|
var app = builder.Build();
|
|
|
|
app.UseAuthorization();
|
|
app.UseSerilogRequestLogging();
|
|
|
|
app.MapControllers();
|
|
app.Run();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Log.Fatal(ex, "An unhandled exception occurred during runtime");
|
|
}
|
|
finally
|
|
{
|
|
Log.CloseAndFlush();
|
|
}
|
|
}
|
|
}
|
|
}
|