summaryrefslogtreecommitdiff
path: root/Program.cs
diff options
context:
space:
mode:
authorJake Mannens <jake@asger.xyz>2026-05-06 22:33:52 +1000
committerJake Mannens <jake@asger.xyz>2026-05-06 22:33:52 +1000
commit2b66d00175950d845a794422433d4a350cf87775 (patch)
tree8b0a77d43d80faab235c14008206a926d4566859 /Program.cs
parent60dd44153b5f2b233dc66032507ee6c9a925ed0e (diff)
v0.13av0.13a
Diffstat (limited to 'Program.cs')
-rw-r--r--Program.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Program.cs b/Program.cs
index 548f6e9..34db56f 100644
--- a/Program.cs
+++ b/Program.cs
@@ -1,8 +1,9 @@
-using Microsoft.EntityFrameworkCore;
-using System.Text.Json.Serialization;
using HyperBooru.Services;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.DataProtection;
+using Microsoft.AspNetCore.Http.Json;
+using Microsoft.EntityFrameworkCore;
+using System.Text.Json.Serialization;
namespace HyperBooru;
@@ -17,6 +18,9 @@ public class Program {
var converter = new JsonStringEnumConverter();
o.JsonSerializerOptions.Converters.Add(converter);
});
+ builder.Services.Configure<JsonOptions>(o => {
+ o.SerializerOptions.TypeInfoResolverChain.Insert(0, new ExceptionJsonResolver());
+ });
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
@@ -49,6 +53,7 @@ public class Program {
app.UseHsts();
app.UseHttpsRedirection();
app.UseStaticFiles();
+ app.UseMiddleware<ExceptionMiddleware>();
app.UseRouting();
app.MapBlazorHub();
app.MapControllers();