This commit is contained in:
michele 2025-01-30 16:45:14 +01:00
commit a22d21f30c
2 changed files with 8 additions and 6 deletions

View File

@ -10,19 +10,21 @@ var builder = WebApplication.CreateBuilder(args);
// Enable legacy TLS protocols (TLS 1.0/1.1)
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
//PORTE DEL SERVIZIO
builder.WebHost.UseUrls("http://0.0.0.0:5000");
// Add services to the container.
builder.Services.AddControllers();
#region istanze dbContext
builder.Services.AddDbContext<PiDbContext>(options =>
options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection")));
builder.Services.AddDbContext<PiDbContext>(options =>
options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection")));
#endregion
builder.Services.AddControllers();
//builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
@ -33,12 +35,12 @@ var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseMiddleware<TokenAuthenticationController>();
app.UseSwagger();
app.UseSwaggerUI();
app.UseAuthorization();
app.MapControllers();

View File

@ -7,6 +7,6 @@
},
"AllowedHosts": "*",
"ConnectionStrings": {
"DefaultConnection": "Data Source=poloinformatico15.clienti.init-s.it;Initial Catalog=AHR_PI;User Id=sa; Password=p0l01nf.;Integrated Security=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False; encrypt=false"
"DefaultConnection": "Data Source=poloinformatico15.clienti.init-s.it;Initial Catalog=AHR_PI;User Id=sa; Password=p0l01nf.;Integrated Security=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False;Encrypt=False"
}
}