[FA-13] Adds Fusion gateway, need to setup a local build and stitch process. Only NovelService included right now.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user