2023-11-25 08:24:04 +00:00
|
|
|
using API_SequentMicrosystems.Services;
|
2023-11-25 18:00:12 +00:00
|
|
|
using System.Text.Json;
|
|
|
|
using System.Text.Json.Serialization;
|
2023-11-25 08:24:04 +00:00
|
|
|
|
|
|
|
namespace API_SequentMicrosystems
|
|
|
|
{
|
|
|
|
public class Program
|
|
|
|
{
|
|
|
|
public static void Main(string[] args)
|
|
|
|
{
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
|
|
|
|
// Add services to the container.
|
|
|
|
|
2023-11-25 18:00:12 +00:00
|
|
|
builder.Services.AddControllers().AddNewtonsoftJson();
|
2023-11-25 08:24:04 +00:00
|
|
|
|
|
|
|
builder.Services.AddSingleton<RTDDAService>();
|
2023-11-25 18:00:12 +00:00
|
|
|
builder.Services.AddSingleton<PointsService>();
|
2023-11-25 08:24:04 +00:00
|
|
|
|
|
|
|
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
|
|
|
builder.Services.AddEndpointsApiExplorer();
|
|
|
|
builder.Services.AddSwaggerGen();
|
|
|
|
|
|
|
|
var app = builder.Build();
|
|
|
|
|
|
|
|
// Configure the HTTP request pipeline.
|
|
|
|
if (true)//app.Environment.IsDevelopment())
|
|
|
|
{
|
|
|
|
app.UseSwagger();
|
|
|
|
app.UseSwaggerUI();
|
|
|
|
}
|
|
|
|
|
|
|
|
app.UseAuthorization();
|
|
|
|
|
|
|
|
app.Services.GetService<RTDDAService>();
|
2023-11-25 18:00:12 +00:00
|
|
|
app.Services.GetService<PointsService>();
|
2023-11-25 08:24:04 +00:00
|
|
|
|
|
|
|
app.MapControllers();
|
|
|
|
|
|
|
|
app.Run();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|