From 0272be35ad333b176bccc88fe051aca94f2fbae7 Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 5 Jun 2023 01:04:36 -0500 Subject: [PATCH] Add project files. --- Squiddler-Server-Lite.sln | 25 +++++++++++ Squiddler-Server-Lite/Program.cs | 44 +++++++++++++++++++ .../Properties/launchSettings.json | 41 +++++++++++++++++ .../Squiddler-Server-Lite.csproj | 15 +++++++ .../appsettings.Development.json | 8 ++++ Squiddler-Server-Lite/appsettings.json | 9 ++++ 6 files changed, 142 insertions(+) create mode 100644 Squiddler-Server-Lite.sln create mode 100644 Squiddler-Server-Lite/Program.cs create mode 100644 Squiddler-Server-Lite/Properties/launchSettings.json create mode 100644 Squiddler-Server-Lite/Squiddler-Server-Lite.csproj create mode 100644 Squiddler-Server-Lite/appsettings.Development.json create mode 100644 Squiddler-Server-Lite/appsettings.json diff --git a/Squiddler-Server-Lite.sln b/Squiddler-Server-Lite.sln new file mode 100644 index 0000000..03cda07 --- /dev/null +++ b/Squiddler-Server-Lite.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.6.33723.286 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Squiddler-Server-Lite", "Squiddler-Server-Lite\Squiddler-Server-Lite.csproj", "{89A88EA7-771B-4E74-B662-C13363C4C140}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {89A88EA7-771B-4E74-B662-C13363C4C140}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {89A88EA7-771B-4E74-B662-C13363C4C140}.Debug|Any CPU.Build.0 = Debug|Any CPU + {89A88EA7-771B-4E74-B662-C13363C4C140}.Release|Any CPU.ActiveCfg = Release|Any CPU + {89A88EA7-771B-4E74-B662-C13363C4C140}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {082A8123-BFEC-4F94-9152-FCCCB411DA13} + EndGlobalSection +EndGlobal diff --git a/Squiddler-Server-Lite/Program.cs b/Squiddler-Server-Lite/Program.cs new file mode 100644 index 0000000..bb04eb2 --- /dev/null +++ b/Squiddler-Server-Lite/Program.cs @@ -0,0 +1,44 @@ +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(); + +internal record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary) +{ + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); +} diff --git a/Squiddler-Server-Lite/Properties/launchSettings.json b/Squiddler-Server-Lite/Properties/launchSettings.json new file mode 100644 index 0000000..7136ef2 --- /dev/null +++ b/Squiddler-Server-Lite/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:17598", + "sslPort": 44342 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5190", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7288;http://localhost:5190", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/Squiddler-Server-Lite/Squiddler-Server-Lite.csproj b/Squiddler-Server-Lite/Squiddler-Server-Lite.csproj new file mode 100644 index 0000000..699ab8d --- /dev/null +++ b/Squiddler-Server-Lite/Squiddler-Server-Lite.csproj @@ -0,0 +1,15 @@ + + + + net7.0 + enable + enable + Squiddler_Server_Lite + + + + + + + + diff --git a/Squiddler-Server-Lite/appsettings.Development.json b/Squiddler-Server-Lite/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/Squiddler-Server-Lite/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/Squiddler-Server-Lite/appsettings.json b/Squiddler-Server-Lite/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/Squiddler-Server-Lite/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +}