From 7c33b3f334cf91918add7af08866f2ea37ed9c3f Mon Sep 17 00:00:00 2001 From: Melodi <62381002+Melodi17@users.noreply.github.com> Date: Thu, 3 Sep 2026 23:06:05 +1000 Subject: chore: initial commit --- src/marlin.web/Program.cs | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/marlin.web/Program.cs (limited to 'src/marlin.web/Program.cs') diff --git a/src/marlin.web/Program.cs b/src/marlin.web/Program.cs new file mode 100644 index 0000000..cf330b2 --- /dev/null +++ b/src/marlin.web/Program.cs @@ -0,0 +1,42 @@ +using marlin.web.Data; +using marlin.web.Services; +using Microsoft.EntityFrameworkCore; + +DotNetEnv.Env.NoClobber().TraversePath().Load(); + +var builder = WebApplication.CreateBuilder(args); + +builder.Services.AddDbContext(options => options + .UseNpgsql(builder.Configuration.GetConnectionString("Master")) + .UseSnakeCaseNamingConvention()); + +builder.Services.AddHostedService(); +builder.Services.AddHostedService(); + +// Add services to the container. +builder.Services.AddControllersWithViews(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (!app.Environment.IsDevelopment()) +{ + app.UseExceptionHandler("/Home/Error"); + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + app.UseHsts(); +} + +app.UseHttpsRedirection(); +app.UseRouting(); + +app.UseAuthorization(); + +app.MapStaticAssets(); + +app + .MapControllerRoute( + name: "default", + pattern: "{controller=Home}/{action=Index}/{id?}") + .WithStaticAssets(); + +app.Run(); \ No newline at end of file -- cgit v1.3.1