Hot Chocolate, AWS EC2 docker instance

Hot Chocolate, AWS EC2 docker instance


0

i have deployed asp.net in docker on ec2 instance ECS, with load balancer

controller weatherforecast working corectly

hotchocolate graphql UI doesnt work on aws, on localhost docker works fine.

I test on postman, and works fine, schema fetched.

Can you help with aws settings, for graphql working

My actual program.cs

builder.Services.AddGraphQLServer().AddQueryType<GraphQls>();
builder.Services.AddCors(
    options =>
        options.AddPolicy(
            "CorsPolicy",
            builder =>
            {
                builder.AllowAnyMethod().AllowAnyHeader().AllowCredentials()
                 .SetIsOriginAllowed(_ => true);
                // #if DEBUG
                //                     .SetIsOriginAllowed(_ => true);
                // #else
                //                     .WithOrigins("https://localhost", "https://localhost");
                // #endif
            }
        )
);

var app = builder.Build();

// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
    app.UseSwagger();
    app.UseSwaggerUI();
}

//app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();

app.MapGraphQL();

Best regards


Load 5 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *