Adds streaming to GetContents
This commit is contained in:
@@ -5,8 +5,9 @@ using Hutopy.Infrastructure;
|
||||
using Hutopy.Infrastructure.Data;
|
||||
using Hutopy.Infrastructure.Identity;
|
||||
using Hutopy.Web;
|
||||
using Hutopy.Web.Contents;
|
||||
using Hutopy.Web.Contents.Data;
|
||||
using Hutopy.Web.Messages.Data;
|
||||
using Hutopy.Web.Messages;
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using NSwag;
|
||||
@@ -37,7 +38,7 @@ builder.Services.AddCors(options =>
|
||||
.AllowAnyHeader()
|
||||
.AllowCredentials();
|
||||
});
|
||||
|
||||
|
||||
options.AddPolicy("AllowHutopyUiPreview", policy =>
|
||||
{
|
||||
policy.WithOrigins("https://zealous-bay-08204590f-preview.eastus2.5.azurestaticapps.net")
|
||||
@@ -78,20 +79,12 @@ builder.Services.AddOpenApiDocument((configure, sp) =>
|
||||
configure.OperationProcessors.Add(new AspNetCoreOperationSecurityScopeProcessor("JWT"));
|
||||
});
|
||||
|
||||
builder.Services.AddFastEndpoints();
|
||||
|
||||
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection")
|
||||
?? throw new InvalidOperationException("Missing ConnectionStrings:DefaultConnection");
|
||||
|
||||
builder.Services.AddDbContext<MessagingDbContext>((_, options) =>
|
||||
{
|
||||
options.UseSqlServer(connectionString);
|
||||
});
|
||||
|
||||
builder.Services.AddDbContext<ContentDbContext>((_, options) =>
|
||||
{
|
||||
options.UseSqlServer(connectionString);
|
||||
});
|
||||
builder.Services.AddFastEndpoints();
|
||||
builder.Services.AddContentModule(options => options.UseSqlServer(connectionString));
|
||||
builder.Services.AddMessagingModule(options => options.UseSqlServer(connectionString));
|
||||
|
||||
builder.Services.Configure<JwtOptions>(builder.Configuration.GetRequiredSection(JwtOptions.SectionName));
|
||||
|
||||
@@ -109,7 +102,8 @@ app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
|
||||
// Initialize and seed the db.
|
||||
await app.InitialiseDatabaseAsync();
|
||||
await app.InitialiseApplicationDatabaseAsync();
|
||||
await app.InitialiseContentDatabaseAsync();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (!app.Environment.IsDevelopment())
|
||||
|
||||
Reference in New Issue
Block a user