From e6cb076ab89ced9b497b7c0ef5c416610df5a528 Mon Sep 17 00:00:00 2001 From: Murtadha Date: Thu, 22 Aug 2024 19:52:43 -0400 Subject: [PATCH] v0.0.0 Replace NodeJS with .NET --- docker/docker-compose.yml | 0 src/PortfolioBackend/PortfolioBackend.http | 6 --- src/PortfolioBackend/Program.cs | 44 ------------------- docker/Dockerfile => src/Titan.API/Program.cs | 0 .../Properties/launchSettings.json | 8 ++-- .../Titan.API.csproj} | 7 ++- src/Titan.API/Titan.API.http | 6 +++ .../appsettings.json | 0 .../Titan.Application.csproj | 17 +++++++ src/Titan.Core/Titan.Core.csproj | 9 ++++ .../Titan.Infrastructure.csproj | 20 +++++++++ .../PortfolioBackend.Tests.csproj | 27 ------------ 12 files changed, 62 insertions(+), 82 deletions(-) delete mode 100644 docker/docker-compose.yml delete mode 100644 src/PortfolioBackend/PortfolioBackend.http delete mode 100644 src/PortfolioBackend/Program.cs rename docker/Dockerfile => src/Titan.API/Program.cs (100%) rename src/{PortfolioBackend => Titan.API}/Properties/launchSettings.json (79%) rename src/{PortfolioBackend/PortfolioBackend.csproj => Titan.API/Titan.API.csproj} (62%) create mode 100644 src/Titan.API/Titan.API.http rename src/{PortfolioBackend => Titan.API}/appsettings.json (100%) create mode 100644 src/Titan.Application/Titan.Application.csproj create mode 100644 src/Titan.Core/Titan.Core.csproj create mode 100644 src/Titan.Infrastructure/Titan.Infrastructure.csproj delete mode 100644 tests/PortfolioBackend.Tests/PortfolioBackend.Tests.csproj diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml deleted file mode 100644 index e69de29..0000000 diff --git a/src/PortfolioBackend/PortfolioBackend.http b/src/PortfolioBackend/PortfolioBackend.http deleted file mode 100644 index ceb45ca..0000000 --- a/src/PortfolioBackend/PortfolioBackend.http +++ /dev/null @@ -1,6 +0,0 @@ -@PortfolioBackend_HostAddress = http://localhost:5231 - -GET {{PortfolioBackend_HostAddress}}/weatherforecast/ -Accept: application/json - -### diff --git a/src/PortfolioBackend/Program.cs b/src/PortfolioBackend/Program.cs deleted file mode 100644 index fda9a7d..0000000 --- a/src/PortfolioBackend/Program.cs +++ /dev/null @@ -1,44 +0,0 @@ -var builder = WebApplication.CreateBuilder(args); - -// Add services to the container. -// 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 (app.Environment.IsDevelopment()) -{ - app.UseSwagger(); - app.UseSwaggerUI(); -} - -app.UseHttpsRedirection(); - -var summaries = new[] -{ - "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" -}; - -app.MapGet("/weatherforecast", () => -{ - var forecast = Enumerable.Range(1, 5).Select(index => - new WeatherForecast - ( - DateOnly.FromDateTime(DateTime.Now.AddDays(index)), - Random.Shared.Next(-20, 55), - summaries[Random.Shared.Next(summaries.Length)] - )) - .ToArray(); - return forecast; -}) -.WithName("GetWeatherForecast") -.WithOpenApi(); - -app.Run(); - -record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary) -{ - public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); -} diff --git a/docker/Dockerfile b/src/Titan.API/Program.cs similarity index 100% rename from docker/Dockerfile rename to src/Titan.API/Program.cs diff --git a/src/PortfolioBackend/Properties/launchSettings.json b/src/Titan.API/Properties/launchSettings.json similarity index 79% rename from src/PortfolioBackend/Properties/launchSettings.json rename to src/Titan.API/Properties/launchSettings.json index b09f16a..904d71b 100644 --- a/src/PortfolioBackend/Properties/launchSettings.json +++ b/src/Titan.API/Properties/launchSettings.json @@ -4,8 +4,8 @@ "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { - "applicationUrl": "http://localhost:39132", - "sslPort": 44397 + "applicationUrl": "http://localhost:22924", + "sslPort": 44301 } }, "profiles": { @@ -14,7 +14,7 @@ "dotnetRunMessages": true, "launchBrowser": true, "launchUrl": "swagger", - "applicationUrl": "http://localhost:5231", + "applicationUrl": "http://localhost:5221", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } @@ -24,7 +24,7 @@ "dotnetRunMessages": true, "launchBrowser": true, "launchUrl": "swagger", - "applicationUrl": "https://localhost:7162;http://localhost:5231", + "applicationUrl": "https://localhost:7052;http://localhost:5221", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/src/PortfolioBackend/PortfolioBackend.csproj b/src/Titan.API/Titan.API.csproj similarity index 62% rename from src/PortfolioBackend/PortfolioBackend.csproj rename to src/Titan.API/Titan.API.csproj index 14e5bf3..a6c9074 100644 --- a/src/PortfolioBackend/PortfolioBackend.csproj +++ b/src/Titan.API/Titan.API.csproj @@ -7,8 +7,13 @@ + - + + + + + diff --git a/src/Titan.API/Titan.API.http b/src/Titan.API/Titan.API.http new file mode 100644 index 0000000..7e07c2a --- /dev/null +++ b/src/Titan.API/Titan.API.http @@ -0,0 +1,6 @@ +@Titan.API_HostAddress = http://localhost:5221 + +GET {{Titan.API_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/src/PortfolioBackend/appsettings.json b/src/Titan.API/appsettings.json similarity index 100% rename from src/PortfolioBackend/appsettings.json rename to src/Titan.API/appsettings.json diff --git a/src/Titan.Application/Titan.Application.csproj b/src/Titan.Application/Titan.Application.csproj new file mode 100644 index 0000000..35385ce --- /dev/null +++ b/src/Titan.Application/Titan.Application.csproj @@ -0,0 +1,17 @@ + + + + + + + + + + + + net8.0 + enable + enable + + + diff --git a/src/Titan.Core/Titan.Core.csproj b/src/Titan.Core/Titan.Core.csproj new file mode 100644 index 0000000..bb23fb7 --- /dev/null +++ b/src/Titan.Core/Titan.Core.csproj @@ -0,0 +1,9 @@ + + + + net8.0 + enable + enable + + + diff --git a/src/Titan.Infrastructure/Titan.Infrastructure.csproj b/src/Titan.Infrastructure/Titan.Infrastructure.csproj new file mode 100644 index 0000000..be71bd4 --- /dev/null +++ b/src/Titan.Infrastructure/Titan.Infrastructure.csproj @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + net8.0 + enable + enable + + + diff --git a/tests/PortfolioBackend.Tests/PortfolioBackend.Tests.csproj b/tests/PortfolioBackend.Tests/PortfolioBackend.Tests.csproj deleted file mode 100644 index 9422ebd..0000000 --- a/tests/PortfolioBackend.Tests/PortfolioBackend.Tests.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - - net8.0 - enable - enable - - false - true - - - - - - - - - - - - - - - - - -