parent
608e9a7f9e
commit
ed619cdc17
18 changed files with 47 additions and 46 deletions
14
Program.cs
14
Program.cs
|
@ -1,14 +1,14 @@
|
|||
using System.Reflection;
|
||||
using LookingGlass.Data;
|
||||
using LookingGlass.Util.SwaggerTheme;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using Myhm.Data;
|
||||
using Myhm.Util.SwaggerTheme;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
var config = builder.Configuration.GetSection("Configuration").Get<MyhmConfiguration>();
|
||||
builder.Services.Configure<MyhmConfiguration>(builder.Configuration.GetSection("Configuration"));
|
||||
var config = builder.Configuration.GetSection("Configuration").Get<ApplicationSettings>();
|
||||
builder.Services.Configure<ApplicationSettings>(builder.Configuration.GetSection("Configuration"));
|
||||
|
||||
if ((config?.AuthToken?.Length ?? 0) < 64 && !builder.Environment.IsDevelopment())
|
||||
{
|
||||
|
@ -17,8 +17,8 @@ if ((config?.AuthToken?.Length ?? 0) < 64 && !builder.Environment.IsDevelopment(
|
|||
);
|
||||
}
|
||||
|
||||
builder.Services.AddDbContextFactory<MyhmContext>(options =>
|
||||
options.UseNpgsql(builder.Configuration.GetConnectionString("MyhmContext"))
|
||||
builder.Services.AddDbContextFactory<ApplicationContext>(options =>
|
||||
options.UseNpgsql(builder.Configuration.GetConnectionString("ApplicationContext"))
|
||||
);
|
||||
|
||||
if (config?.UseSentry == true)
|
||||
|
@ -34,7 +34,7 @@ builder.Services.AddSwaggerGen(opts =>
|
|||
"v1",
|
||||
new OpenApiInfo
|
||||
{
|
||||
Title = "Myhm API",
|
||||
Title = "Looking Glass API",
|
||||
Version = "v1",
|
||||
Description = "",
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue