From b255abc5c703062231caeb2d66bfc727c6c1ad77 Mon Sep 17 00:00:00 2001 From: femsci Date: Sat, 18 Nov 2023 01:20:31 +0100 Subject: [PATCH] =?UTF-8?q?Add=20our=20beloved=20Middleware=20Papieskie=20?= =?UTF-8?q?=F0=9F=92=9B=F0=9F=92=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Nyanlabs.Umogen.Server/App.razor | 2 +- .../Data/WeatherForecast.cs | 12 ------------ .../Data/WeatherForecastService.cs | 19 ------------------- .../Nyanlabs.Umogen.Server.csproj | 4 ++++ src/Nyanlabs.Umogen.Server/Program.cs | 6 ++++-- 5 files changed, 9 insertions(+), 34 deletions(-) delete mode 100644 src/Nyanlabs.Umogen.Server/Data/WeatherForecast.cs delete mode 100644 src/Nyanlabs.Umogen.Server/Data/WeatherForecastService.cs diff --git a/src/Nyanlabs.Umogen.Server/App.razor b/src/Nyanlabs.Umogen.Server/App.razor index 6fd3ed1..3e9cdb6 100644 --- a/src/Nyanlabs.Umogen.Server/App.razor +++ b/src/Nyanlabs.Umogen.Server/App.razor @@ -6,7 +6,7 @@ Not found -

Sorry, there's nothing at this address.

+

Sorri but we slipped and forgor the location 💀

diff --git a/src/Nyanlabs.Umogen.Server/Data/WeatherForecast.cs b/src/Nyanlabs.Umogen.Server/Data/WeatherForecast.cs deleted file mode 100644 index 0a45384..0000000 --- a/src/Nyanlabs.Umogen.Server/Data/WeatherForecast.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Nyanlabs.Umogen.Server.Data; - -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/src/Nyanlabs.Umogen.Server/Data/WeatherForecastService.cs b/src/Nyanlabs.Umogen.Server/Data/WeatherForecastService.cs deleted file mode 100644 index eea977f..0000000 --- a/src/Nyanlabs.Umogen.Server/Data/WeatherForecastService.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace Nyanlabs.Umogen.Server.Data; - -public class WeatherForecastService -{ - private static readonly string[] Summaries = new[] - { - "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; - - public Task GetForecastAsync(DateOnly startDate) - { - return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - Date = startDate.AddDays(index), - TemperatureC = Random.Shared.Next(-20, 55), - Summary = Summaries[Random.Shared.Next(Summaries.Length)] - }).ToArray()); - } -} diff --git a/src/Nyanlabs.Umogen.Server/Nyanlabs.Umogen.Server.csproj b/src/Nyanlabs.Umogen.Server/Nyanlabs.Umogen.Server.csproj index 7295c13..1770d66 100644 --- a/src/Nyanlabs.Umogen.Server/Nyanlabs.Umogen.Server.csproj +++ b/src/Nyanlabs.Umogen.Server/Nyanlabs.Umogen.Server.csproj @@ -4,6 +4,10 @@ + + + + net8.0 enable diff --git a/src/Nyanlabs.Umogen.Server/Program.cs b/src/Nyanlabs.Umogen.Server/Program.cs index 7cd2c8b..11fa1b3 100644 --- a/src/Nyanlabs.Umogen.Server/Program.cs +++ b/src/Nyanlabs.Umogen.Server/Program.cs @@ -1,11 +1,11 @@ -using Nyanlabs.Umogen.Server.Data; +using Femsci.AspapajNet; var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddRazorPages(); builder.Services.AddServerSideBlazor(); -builder.Services.AddSingleton(); +builder.Services.AddPapiez(); var app = builder.Build(); @@ -18,6 +18,8 @@ if (!app.Environment.IsDevelopment()) app.UseHttpsRedirection(); +app.UsePapiez(); + app.UseStaticFiles(); app.UseRouting();