♻️ No idea what happended
This commit is contained in:
@@ -1,36 +1,50 @@
|
||||
using System.Text.Json;
|
||||
using DysonNetwork.Pass;
|
||||
using DysonNetwork.Pass.Account;
|
||||
using DysonNetwork.Pass.Auth;
|
||||
using DysonNetwork.Pass.Localization;
|
||||
using DysonNetwork.Pass.Startup;
|
||||
using DysonNetwork.Shared.Etcd;
|
||||
using DysonNetwork.Shared.Startup;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using MagicOnion.Server;
|
||||
using NodaTime;
|
||||
using NodaTime.Serialization.SystemTextJson;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.ConfigureAppKestrel();
|
||||
builder.Services.AddHttpClient();
|
||||
|
||||
builder.Services.AddControllers().AddJsonOptions(options =>
|
||||
{
|
||||
options.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower;
|
||||
options.JsonSerializerOptions.DictionaryKeyPolicy = JsonNamingPolicy.SnakeCaseLower;
|
||||
|
||||
options.JsonSerializerOptions.ConfigureForNodaTime(DateTimeZoneProviders.Tzdb);
|
||||
}).AddDataAnnotationsLocalization(options =>
|
||||
{
|
||||
options.DataAnnotationLocalizerProvider = (type, factory) =>
|
||||
factory.Create(typeof(SharedResource));
|
||||
});
|
||||
builder.Services.AddRazorPages();
|
||||
builder.Services.AddAppSwagger();
|
||||
builder.Services.AddAppAuthentication();
|
||||
builder.Services.AddAppRateLimiting();
|
||||
|
||||
builder.Services.AddMagicOnion();
|
||||
builder.Services.AddEtcdService(builder.Configuration);
|
||||
|
||||
builder.Services.AddAppBusinessServices(builder.Configuration);
|
||||
builder.Services.AddAppServices(builder.Configuration);
|
||||
|
||||
builder.Services.AddControllers();
|
||||
builder.Services.AddMagicOnion();
|
||||
builder.Services.AddDbContext<AppDatabase>(options =>
|
||||
options.UseNpgsql(builder.Configuration.GetConnectionString("App")));
|
||||
|
||||
builder.Services.AddScoped<AccountService>();
|
||||
builder.Services.AddScoped<AuthService>();
|
||||
builder.Services.AddScoped<DysonNetwork.Pass.Publisher.PublisherService>();
|
||||
builder.Services.AddScoped<DysonNetwork.Pass.Developer.CustomAppService>();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
app.UseStaticFiles();
|
||||
app.UseAuthorization();
|
||||
app.ConfigureAppMiddleware(builder.Configuration);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user