2023-05-04 15:22:58 +00:00
|
|
|
using InnovEnergy.App.VrmGrabber.Database;
|
2023-04-27 14:59:45 +00:00
|
|
|
using Microsoft.OpenApi.Models;
|
|
|
|
|
2023-05-04 15:22:58 +00:00
|
|
|
namespace InnovEnergy.App.VrmGrabber;
|
2023-04-27 14:59:45 +00:00
|
|
|
|
|
|
|
public static class Program
|
|
|
|
{
|
2023-05-11 15:02:13 +00:00
|
|
|
public static async Task Main(String[] args)
|
2023-04-27 14:59:45 +00:00
|
|
|
{
|
2023-06-01 13:29:39 +00:00
|
|
|
var updateTask = Db.UpdateDetailsAndInstallations();
|
2023-04-27 14:59:45 +00:00
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
|
|
|
|
builder.Services.AddControllers();
|
2023-06-01 13:29:39 +00:00
|
|
|
// builder.Services.AddSwaggerGen(c =>
|
|
|
|
// {
|
|
|
|
// c.UseAllOfToExtendReferenceSchemas();
|
|
|
|
// c.SupportNonNullableReferenceTypes();
|
|
|
|
// });
|
2023-04-27 14:59:45 +00:00
|
|
|
|
|
|
|
var app = builder.Build();
|
2023-06-01 13:29:39 +00:00
|
|
|
// app.UseSwagger();
|
|
|
|
// app.UseSwaggerUI();
|
|
|
|
// app.UseHttpsRedirection();
|
2023-04-27 14:59:45 +00:00
|
|
|
app.MapControllers();
|
2023-05-04 15:22:58 +00:00
|
|
|
// app.MapGet("/", () => Controller.Index());
|
2023-05-11 15:02:13 +00:00
|
|
|
var webTask = app.RunAsync();
|
2023-07-27 14:51:57 +00:00
|
|
|
await Task.WhenAll(webTask, updateTask);
|
2023-04-27 14:59:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private static OpenApiInfo OpenApiInfo { get; } = new OpenApiInfo
|
|
|
|
{
|
|
|
|
Title = "InnovEnergy VRM Grabber",
|
|
|
|
Version = "v1"
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|