[FA-13] Adds Fusion gateway, need to setup a local build and stitch process. Only NovelService included right now.

This commit is contained in:
gamer147
2025-11-22 00:33:06 -05:00
parent 592fa7fb36
commit ffa51cfce4
9 changed files with 45 additions and 116 deletions

View File

@@ -1,3 +1,5 @@
using FictionArchive.Service.Shared.Extensions;
namespace FictionArchive.API;
public class Program
@@ -6,38 +8,26 @@ public class Program
{
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
// OpenAPI & REST
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddMemoryCache();
builder.Services.AddHealthChecks();
#region Fusion Gateway
builder.Services.AddHttpClient("Fusion");
builder.Services
.AddFusionGatewayServer()
.ConfigureFromFile("gateway.fgp")
.CoreBuilder.ApplySaneDefaults();
#endregion
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseAuthentication();
app.UseAuthorization();
app.MapGraphQL();
app.MapHealthChecks("/healthz");
app.MapControllers();
app.MapGraphQL();
app.Run();
}