From 16c3d670498fb211c469621f45292e61b9388171 Mon Sep 17 00:00:00 2001 From: SimonFJ20 Date: Tue, 4 Feb 2025 15:11:55 +0100 Subject: [PATCH] delete API/ --- API/.dockerignore | 30 ----------- API/API.csproj | 18 ------- API/API.csproj.user | 9 ---- API/API.http | 6 --- API/API.sln | 25 ---------- API/Controllers/WeatherForecastController.cs | 33 ------------- API/Dockerfile | 25 ---------- API/Program.cs | 42 ---------------- API/Properties/launchSettings.json | 52 -------------------- API/WeatherForecast.cs | 13 ----- API/appsettings.Development.json | 8 --- API/appsettings.json | 9 ---- 12 files changed, 270 deletions(-) delete mode 100644 API/.dockerignore delete mode 100644 API/API.csproj delete mode 100644 API/API.csproj.user delete mode 100644 API/API.http delete mode 100644 API/API.sln delete mode 100644 API/Controllers/WeatherForecastController.cs delete mode 100644 API/Dockerfile delete mode 100644 API/Program.cs delete mode 100644 API/Properties/launchSettings.json delete mode 100644 API/WeatherForecast.cs delete mode 100644 API/appsettings.Development.json delete mode 100644 API/appsettings.json diff --git a/API/.dockerignore b/API/.dockerignore deleted file mode 100644 index fe1152b..0000000 --- a/API/.dockerignore +++ /dev/null @@ -1,30 +0,0 @@ -**/.classpath -**/.dockerignore -**/.env -**/.git -**/.gitignore -**/.project -**/.settings -**/.toolstarget -**/.vs -**/.vscode -**/*.*proj.user -**/*.dbmdl -**/*.jfm -**/azds.yaml -**/bin -**/charts -**/docker-compose* -**/Dockerfile* -**/node_modules -**/npm-debug.log -**/obj -**/secrets.dev.yaml -**/values.dev.yaml -LICENSE -README.md -!**/.gitignore -!.git/HEAD -!.git/config -!.git/packed-refs -!.git/refs/heads/** \ No newline at end of file diff --git a/API/API.csproj b/API/API.csproj deleted file mode 100644 index 9397a87..0000000 --- a/API/API.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net8.0 - enable - enable - true - 5272047f-41e7-4ae3-9da8-375d50b43476 - Linux - . - - - - - - - - diff --git a/API/API.csproj.user b/API/API.csproj.user deleted file mode 100644 index c404400..0000000 --- a/API/API.csproj.user +++ /dev/null @@ -1,9 +0,0 @@ - - - - https - - - ProjectDebugger - - \ No newline at end of file diff --git a/API/API.http b/API/API.http deleted file mode 100644 index 2cc9420..0000000 --- a/API/API.http +++ /dev/null @@ -1,6 +0,0 @@ -@API_HostAddress = http://localhost:5287 - -GET {{API_HostAddress}}/weatherforecast/ -Accept: application/json - -### diff --git a/API/API.sln b/API/API.sln deleted file mode 100644 index 2b04475..0000000 --- a/API/API.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.8.34511.84 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "API", "API.csproj", "{5DF9B7D8-FA4E-4209-A677-C4CF4886D4B3}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5DF9B7D8-FA4E-4209-A677-C4CF4886D4B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5DF9B7D8-FA4E-4209-A677-C4CF4886D4B3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5DF9B7D8-FA4E-4209-A677-C4CF4886D4B3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5DF9B7D8-FA4E-4209-A677-C4CF4886D4B3}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {C4DFE08A-924F-43DB-BBFC-FE2A54DF41DF} - EndGlobalSection -EndGlobal diff --git a/API/Controllers/WeatherForecastController.cs b/API/Controllers/WeatherForecastController.cs deleted file mode 100644 index aaf3a93..0000000 --- a/API/Controllers/WeatherForecastController.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -namespace API.Controllers -{ - [ApiController] - [Route("[controller]")] - public class WeatherForecastController : ControllerBase - { - private static readonly string[] Summaries = new[] - { - "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; - - private readonly ILogger _logger; - - public WeatherForecastController(ILogger logger) - { - _logger = logger; - } - - [HttpGet(Name = "GetWeatherForecast")] - public IEnumerable Get() - { - return Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)), - TemperatureC = Random.Shared.Next(-20, 55), - Summary = Summaries[Random.Shared.Next(Summaries.Length)] - }) - .ToArray(); - } - } -} diff --git a/API/Dockerfile b/API/Dockerfile deleted file mode 100644 index a23f64c..0000000 --- a/API/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. - -FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base -USER app -WORKDIR /app -EXPOSE 8080 -EXPOSE 8081 - -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build -ARG BUILD_CONFIGURATION=Release -WORKDIR /src -COPY ["API.csproj", "."] -RUN dotnet restore "./././API.csproj" -COPY . . -WORKDIR "/src/." -RUN dotnet build "./API.csproj" -c $BUILD_CONFIGURATION -o /app/build - -FROM build AS publish -ARG BUILD_CONFIGURATION=Release -RUN dotnet publish "./API.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false - -FROM base AS final -WORKDIR /app -COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "API.dll"] \ No newline at end of file diff --git a/API/Program.cs b/API/Program.cs deleted file mode 100644 index 6ffa8ba..0000000 --- a/API/Program.cs +++ /dev/null @@ -1,42 +0,0 @@ -namespace API -{ - public class Program - { - public static void Main(string[] args) - { - var MyAllowSpecificOrigins = "_myAllowSpecificOrigins"; - var builder = WebApplication.CreateBuilder(args); - builder.Services.AddCors(options => - { - options.AddPolicy( - name: MyAllowSpecificOrigins, - policy => - { - policy.WithOrigins("*").AllowAnyMethod().AllowAnyHeader(); - } - ); - }); - // Add services to the container. - - builder.Services.AddControllers(); - // 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. - app.UseSwagger(); - app.UseSwaggerUI(); - - app.UseHttpsRedirection(); - - app.UseCors(MyAllowSpecificOrigins); - app.UseAuthorization(); - - app.MapControllers(); - - app.Run(); - } - } -} diff --git a/API/Properties/launchSettings.json b/API/Properties/launchSettings.json deleted file mode 100644 index 687f3f5..0000000 --- a/API/Properties/launchSettings.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "profiles": { - "http": { - "commandName": "Project", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "dotnetRunMessages": true, - "applicationUrl": "http://localhost:5287" - }, - "https": { - "commandName": "Project", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "dotnetRunMessages": true, - "applicationUrl": "https://localhost:7173;http://localhost:5287" - }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Docker": { - "commandName": "Docker", - "launchBrowser": true, - "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", - "environmentVariables": { - "ASPNETCORE_HTTPS_PORTS": "8081", - "ASPNETCORE_HTTP_PORTS": "8080" - }, - "publishAllPorts": true, - "useSSL": true - } - }, - "$schema": "http://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:13557", - "sslPort": 44384 - } - } -} \ No newline at end of file diff --git a/API/WeatherForecast.cs b/API/WeatherForecast.cs deleted file mode 100644 index 10c41a8..0000000 --- a/API/WeatherForecast.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace API -{ - public class WeatherForecast - { - public DateOnly Date { get; set; } - - public int TemperatureC { get; set; } - - public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); - - public string? Summary { get; set; } - } -} diff --git a/API/appsettings.Development.json b/API/appsettings.Development.json deleted file mode 100644 index 0c208ae..0000000 --- a/API/appsettings.Development.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - } -} diff --git a/API/appsettings.json b/API/appsettings.json deleted file mode 100644 index 10f68b8..0000000 --- a/API/appsettings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*" -}