From 4baf2d8fa1f1d27e3f604edd6e04861365b19254 Mon Sep 17 00:00:00 2001 From: Drew Rautenberg Date: Tue, 7 Jan 2025 11:39:01 -0600 Subject: [PATCH] base files --- .gitignore | 5 ++++ barkman.sln | 16 ++++++++++ barkman/Program.cs | 41 ++++++++++++++++++++++++++ barkman/Properties/launchSettings.json | 23 +++++++++++++++ barkman/appsettings.Development.json | 8 +++++ barkman/appsettings.json | 9 ++++++ barkman/barkman.csproj | 13 ++++++++ barkman/barkman.http | 6 ++++ 8 files changed, 121 insertions(+) create mode 100644 .gitignore create mode 100644 barkman.sln create mode 100644 barkman/Program.cs create mode 100644 barkman/Properties/launchSettings.json create mode 100644 barkman/appsettings.Development.json create mode 100644 barkman/appsettings.json create mode 100644 barkman/barkman.csproj create mode 100644 barkman/barkman.http diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..add57be --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +bin/ +obj/ +/packages/ +riderModule.iml +/_ReSharper.Caches/ \ No newline at end of file diff --git a/barkman.sln b/barkman.sln new file mode 100644 index 0000000..1fe295e --- /dev/null +++ b/barkman.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "barkman", "barkman\barkman.csproj", "{625B24F1-FA8F-45F6-B3C8-22C538112B65}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {625B24F1-FA8F-45F6-B3C8-22C538112B65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {625B24F1-FA8F-45F6-B3C8-22C538112B65}.Debug|Any CPU.Build.0 = Debug|Any CPU + {625B24F1-FA8F-45F6-B3C8-22C538112B65}.Release|Any CPU.ActiveCfg = Release|Any CPU + {625B24F1-FA8F-45F6-B3C8-22C538112B65}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/barkman/Program.cs b/barkman/Program.cs new file mode 100644 index 0000000..d5e0ef3 --- /dev/null +++ b/barkman/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/barkman/Properties/launchSettings.json b/barkman/Properties/launchSettings.json new file mode 100644 index 0000000..f2d052a --- /dev/null +++ b/barkman/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:5211", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": false, + "applicationUrl": "https://localhost:7157;http://localhost:5211", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/barkman/appsettings.Development.json b/barkman/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/barkman/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/barkman/appsettings.json b/barkman/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/barkman/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/barkman/barkman.csproj b/barkman/barkman.csproj new file mode 100644 index 0000000..c741fda --- /dev/null +++ b/barkman/barkman.csproj @@ -0,0 +1,13 @@ + + + + net9.0 + enable + enable + + + + + + + diff --git a/barkman/barkman.http b/barkman/barkman.http new file mode 100644 index 0000000..cf1c801 --- /dev/null +++ b/barkman/barkman.http @@ -0,0 +1,6 @@ +@barkman_HostAddress = http://localhost:5211 + +GET {{barkman_HostAddress}}/weatherforecast/ +Accept: application/json + +###