41 lines
892 B
C#
41 lines
892 B
C#
using System.Reflection;
|
|
using AfRApay.Web.Backend;
|
|
using LinqToDB.Data;
|
|
|
|
DataConnection.DefaultSettings = new Database.Settings();
|
|
Migrations.RunMigrations();
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
builder.Services.AddRazorPages();
|
|
builder.Services.AddSwaggerGen(options => {
|
|
var xmlFilename = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
|
|
options.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, xmlFilename));
|
|
});
|
|
|
|
#if (DEBUG)
|
|
builder.Services.AddControllers().AddRazorRuntimeCompilation();
|
|
builder.Services.AddControllers();
|
|
#else
|
|
builder.Services.AddControllers();
|
|
#endif
|
|
|
|
var app = builder.Build();
|
|
|
|
if (app.Environment.IsDevelopment()) {
|
|
app.UseSwagger();
|
|
app.UseSwaggerUI();
|
|
}
|
|
|
|
app.UseStatusCodePagesWithReExecute("/Error");
|
|
|
|
app.UseStaticFiles();
|
|
|
|
app.UseRouting();
|
|
app.UseAuthorization();
|
|
|
|
app.MapRazorPages();
|
|
app.MapControllers();
|
|
|
|
app.Run();
|