From bceaf8ef5afae65a6c2d5e93f89585d0a14ec214 Mon Sep 17 00:00:00 2001 From: ThorHansen1999 <10503111@ucn.dk> Date: Fri, 9 Oct 2026 11:25:51 +0200 Subject: [PATCH] Add initial project files and configuration --- .../.idea.WebApplication1/.idea/.gitignore | 15 +++++++ .../.idea/indexLayout.xml | 8 ++++ .../.idea/.idea.WebApplication1/.idea/vcs.xml | 6 +++ WebApplication1/WebApplication1.sln | 16 ++++++++ WebApplication1/WebApplication1/Program.cs | 41 +++++++++++++++++++ .../Properties/launchSettings.json | 23 +++++++++++ .../WebApplication1/WebApplication1.csproj | 13 ++++++ .../WebApplication1/WebApplication1.http | 6 +++ .../appsettings.Development.json | 8 ++++ .../WebApplication1/appsettings.json | 9 ++++ 10 files changed, 145 insertions(+) create mode 100644 WebApplication1/.idea/.idea.WebApplication1/.idea/.gitignore create mode 100644 WebApplication1/.idea/.idea.WebApplication1/.idea/indexLayout.xml create mode 100644 WebApplication1/.idea/.idea.WebApplication1/.idea/vcs.xml create mode 100644 WebApplication1/WebApplication1.sln create mode 100644 WebApplication1/WebApplication1/Program.cs create mode 100644 WebApplication1/WebApplication1/Properties/launchSettings.json create mode 100644 WebApplication1/WebApplication1/WebApplication1.csproj create mode 100644 WebApplication1/WebApplication1/WebApplication1.http create mode 100644 WebApplication1/WebApplication1/appsettings.Development.json create mode 100644 WebApplication1/WebApplication1/appsettings.json diff --git a/WebApplication1/.idea/.idea.WebApplication1/.idea/.gitignore b/WebApplication1/.idea/.idea.WebApplication1/.idea/.gitignore new file mode 100644 index 0000000..16091a0 --- /dev/null +++ b/WebApplication1/.idea/.idea.WebApplication1/.idea/.gitignore @@ -0,0 +1,15 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Rider ignored files +/modules.xml +/contentModel.xml +/projectSettingsUpdater.xml +/.idea.WebApplication1.iml +# Ignored default folder with query files +/queries/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/WebApplication1/.idea/.idea.WebApplication1/.idea/indexLayout.xml b/WebApplication1/.idea/.idea.WebApplication1/.idea/indexLayout.xml new file mode 100644 index 0000000..7b08163 --- /dev/null +++ b/WebApplication1/.idea/.idea.WebApplication1/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/WebApplication1/.idea/.idea.WebApplication1/.idea/vcs.xml b/WebApplication1/.idea/.idea.WebApplication1/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/WebApplication1/.idea/.idea.WebApplication1/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/WebApplication1/WebApplication1.sln b/WebApplication1/WebApplication1.sln new file mode 100644 index 0000000..222411d --- /dev/null +++ b/WebApplication1/WebApplication1.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApplication1", "WebApplication1\WebApplication1.csproj", "{7F97C303-6ED9-4285-AE7D-402208CC64EB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7F97C303-6ED9-4285-AE7D-402208CC64EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7F97C303-6ED9-4285-AE7D-402208CC64EB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7F97C303-6ED9-4285-AE7D-402208CC64EB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7F97C303-6ED9-4285-AE7D-402208CC64EB}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/WebApplication1/WebApplication1/Program.cs b/WebApplication1/WebApplication1/Program.cs new file mode 100644 index 0000000..d5e0ef3 --- /dev/null +++ b/WebApplication1/WebApplication1/Program.cs @@ -0,0 +1,41 @@ +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. +// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi +builder.Services.AddOpenApi(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.MapOpenApi(); +} + +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"); + +app.Run(); + +record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary) +{ + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); +} \ No newline at end of file diff --git a/WebApplication1/WebApplication1/Properties/launchSettings.json b/WebApplication1/WebApplication1/Properties/launchSettings.json new file mode 100644 index 0000000..eb58de2 --- /dev/null +++ b/WebApplication1/WebApplication1/Properties/launchSettings.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": false, + "applicationUrl": "http://localhost:5297", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": false, + "applicationUrl": "https://localhost:7099;http://localhost:5297", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/WebApplication1/WebApplication1/WebApplication1.csproj b/WebApplication1/WebApplication1/WebApplication1.csproj new file mode 100644 index 0000000..e3bb7b2 --- /dev/null +++ b/WebApplication1/WebApplication1/WebApplication1.csproj @@ -0,0 +1,13 @@ + + + + net10.0 + enable + enable + + + + + + + diff --git a/WebApplication1/WebApplication1/WebApplication1.http b/WebApplication1/WebApplication1/WebApplication1.http new file mode 100644 index 0000000..9abb4d8 --- /dev/null +++ b/WebApplication1/WebApplication1/WebApplication1.http @@ -0,0 +1,6 @@ +@WebApplication1_HostAddress = http://localhost:5297 + +GET {{WebApplication1_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/WebApplication1/WebApplication1/appsettings.Development.json b/WebApplication1/WebApplication1/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/WebApplication1/WebApplication1/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/WebApplication1/WebApplication1/appsettings.json b/WebApplication1/WebApplication1/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/WebApplication1/WebApplication1/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +}