45 lines
1.0 KiB
C#
45 lines
1.0 KiB
C#
using FictionArchive.Service.Shared.Extensions;
|
|
|
|
namespace FictionArchive.API;
|
|
|
|
public class Program
|
|
{
|
|
public static void Main(string[] args)
|
|
{
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
builder.Services.AddHealthChecks();
|
|
|
|
#region Fusion Gateway
|
|
|
|
builder.Services.AddHttpClient("Fusion");
|
|
|
|
builder.Services
|
|
.AddFusionGatewayServer()
|
|
.ConfigureFromFile("gateway.fgp")
|
|
.CoreBuilder.ApplySaneDefaults();
|
|
|
|
#endregion
|
|
|
|
builder.Services.AddCors(options =>
|
|
{
|
|
options.AddPolicy("AllowAllOrigins",
|
|
builder =>
|
|
{
|
|
builder.AllowAnyOrigin()
|
|
.AllowAnyMethod()
|
|
.AllowAnyHeader();
|
|
});
|
|
});
|
|
|
|
var app = builder.Build();
|
|
|
|
app.UseCors("AllowAllOrigins");
|
|
|
|
app.MapHealthChecks("/healthz");
|
|
|
|
app.MapGraphQL();
|
|
|
|
app.RunWithGraphQLCommands(args);
|
|
}
|
|
} |