blob: 8aa73707a1bf5f3c0c759fc466aac5621e14b835 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
using Microsoft.EntityFrameworkCore;
using Spacebar.CleanSettingsRows;
using Spacebar.Models.Db.Contexts;
var builder = Host.CreateApplicationBuilder(args);
if (!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("APPSETTINGS_PATH")))
builder.Configuration.AddJsonFile(Environment.GetEnvironmentVariable("APPSETTINGS_PATH")!);
builder.Services.AddHostedService<Worker>();
builder.Services.AddDbContextPool<SpacebarDbContext>(options => {
options
.UseNpgsql(builder.Configuration.GetConnectionString("Spacebar"))
.EnableDetailedErrors();
});
var host = builder.Build();
host.Run();
|