29 lines
		
	
	
		
			686 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			686 B
		
	
	
	
		
			C#
		
	
	
	
	
	
| using KonSoft.Admin;
 | |
| using KonSoft.Shared.Hosting.AspNetCore;
 | |
| using Microsoft.AspNetCore.Builder;
 | |
| using Serilog;
 | |
| using System;
 | |
| 
 | |
| var assemblyName = typeof(Program).Assembly.GetName().Name!;
 | |
| 
 | |
| SerilogConfigurationHelper.Configure(assemblyName);
 | |
| try
 | |
| {
 | |
|     Log.Information($"Starting {assemblyName}.");
 | |
|     var app = await ApplicationBuilderHelper
 | |
|         .BuildApplicationAsync<AdminHttpApiHostModule>(args);
 | |
|     await app.InitializeApplicationAsync();
 | |
|     app.MapGet("/heath", () => "Online");
 | |
|     await app.RunAsync();
 | |
| 
 | |
|     return 0;
 | |
| }
 | |
| catch (Exception ex)
 | |
| {
 | |
|     Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!");
 | |
|     return 1;
 | |
| }
 | |
| finally
 | |
| {
 | |
|     await Log.CloseAndFlushAsync();
 | |
| } |