From 2a04d7f52c0b23a49133a0cc22ea163e10e7b43f Mon Sep 17 00:00:00 2001 From: "LORENZO\\pacio" Date: Thu, 30 Jan 2025 16:28:00 +0100 Subject: [PATCH] deploy --- ApiAdHoc_Odoo/.config/dotnet-tools.json | 13 +++++++++++++ ApiAdHoc_Odoo/Program.cs | 12 +++++++----- ApiAdHoc_Odoo/appsettings.json | 2 +- 3 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 ApiAdHoc_Odoo/.config/dotnet-tools.json diff --git a/ApiAdHoc_Odoo/.config/dotnet-tools.json b/ApiAdHoc_Odoo/.config/dotnet-tools.json new file mode 100644 index 0000000..159811c --- /dev/null +++ b/ApiAdHoc_Odoo/.config/dotnet-tools.json @@ -0,0 +1,13 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "dotnet-ef": { + "version": "9.0.1", + "commands": [ + "dotnet-ef" + ], + "rollForward": false + } + } +} \ No newline at end of file diff --git a/ApiAdHoc_Odoo/Program.cs b/ApiAdHoc_Odoo/Program.cs index 8731883..ecc05b2 100644 --- a/ApiAdHoc_Odoo/Program.cs +++ b/ApiAdHoc_Odoo/Program.cs @@ -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(options => - options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection"))); builder.Services.AddDbContext(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(); -app.UseSwagger(); -app.UseSwaggerUI(); app.UseAuthorization(); app.MapControllers(); diff --git a/ApiAdHoc_Odoo/appsettings.json b/ApiAdHoc_Odoo/appsettings.json index 294ac90..701842a 100644 --- a/ApiAdHoc_Odoo/appsettings.json +++ b/ApiAdHoc_Odoo/appsettings.json @@ -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" } }