summaryrefslogtreecommitdiff
path: root/HyperBooru.cs
diff options
context:
space:
mode:
Diffstat (limited to 'HyperBooru.cs')
-rw-r--r--HyperBooru.cs37
1 files changed, 0 insertions, 37 deletions
diff --git a/HyperBooru.cs b/HyperBooru.cs
deleted file mode 100644
index e0e1b2d..0000000
--- a/HyperBooru.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using Microsoft.EntityFrameworkCore;
-using System.Text.Json.Serialization;
-
-namespace HyperBooru;
-
-public class HyperBooru {
- public static void Main(string[] args) {
- var builder = WebApplication.CreateBuilder();
- builder.Services.AddEndpointsApiExplorer();
- builder.Services.AddSwaggerGen();
- builder.Services.AddControllers().AddJsonOptions(o => {
- var converter = new JsonStringEnumConverter();
- o.JsonSerializerOptions.Converters.Add(converter);
- });
- builder.Services.AddRazorPages();
- builder.Services.AddSingleton<IConfigService, ConfigService>();
- builder.Services.AddScoped<HyperBooruDbContext>(p =>
- new HyperBooruDbContext(p.GetRequiredService<IConfigService>()));
-
- var app = builder.Build();
-
- using var scope = app.Services.CreateScope();
- using var db = scope.ServiceProvider.GetRequiredService<HyperBooruDbContext>();
- db.Database.Migrate();
-
- #if DEBUG
- app.UseSwagger();
- app.UseSwaggerUI();
- #endif
-
- app.MapRazorPages();
- app.UseStaticFiles();
- app.UseHttpsRedirection();
- app.MapControllers();
- app.Run();
- }
-} \ No newline at end of file