mirror of
https://github.com/raphaeIl/Novaria.git
synced 2025-12-15 07:54:36 +01:00
serverlist handler + basic crypto, rename project
This commit is contained in:
45
Novaria.SDKServer/SDKServer.cs
Normal file
45
Novaria.SDKServer/SDKServer.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user