Skip to content

Commit

Permalink
Agrego puertos
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasdepetrisd committed Feb 21, 2024
1 parent b35d525 commit c4c87c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 26 deletions.
27 changes: 2 additions & 25 deletions src/WebAPI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,6 @@
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();

/*if (builder.Environment.EnvironmentName == "Production")
{
var connectionUrl = Environment.GetEnvironmentVariable("DATABASE_URL");
connectionUrl = connectionUrl.Replace("mssqlserver://", string.Empty);
var userPassSide = connectionUrl.Split("@")[0];
var hostSide = connectionUrl.Split("@")[1];
var user = userPassSide.Split(":")[0];
var password = userPassSide.Split(":")[1];
var host = hostSide.Split("/")[0];
var database = hostSide.Split("/")[1].Split("?")[0];
string defaultConnectionString = $"Host={host};Database={database};Username={user};Password={password};SSL Mode=Require;Trust Server Certificate=true";
// Layers DI
builder.Services
.AddApplication()
.AddInfraestructure(defaultConnectionString);
}
else
{
}*/

// Layers DI
builder.Services
.AddApplication()
Expand Down Expand Up @@ -67,4 +43,5 @@

app.MapControllers();

app.Run();
var port = Environment.GetEnvironmentVariable("PORT") ?? "8080";
app.Run($"http://0.0.0.0:{port}");
3 changes: 2 additions & 1 deletion src/WebAPI/WebAPI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>558b52cc-0347-4758-9da5-b8f4d979b767</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>..\..</DockerfileContext>
<DockerfileFile>..\..\Dockerfile</DockerfileFile>
<DockerfileContext>..\..</DockerfileContext>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit c4c87c5

Please sign in to comment.