-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to hide QueryApi
in OrchardCoreContrib.Apis.Swagger, and also hide the Swagger in a Release environment?
#143
Comments
QueryApi
in OrchardCoreContrib.Apis.SwaggerQueryApi
in OrchardCoreContrib.Apis.Swagger, and also hide the Swagger in a Release environment?
@hishamco I forgot to mention you, do you have any idea about this? At least to hide the Swagger in a Release env. Thank you |
This could be doable by making use of a hosting environment, but I'm not sure why you need to disable the swagger page in the production For the first two questions I need to check if there's a way |
@hishamco thank you for your reply. What do you mean by "making use of a hosting environment"? Is it possible from the var builder = WebApplication.CreateBuilder(args);
builder.Services.AddOrchardCms()
.ConfigureServices(services =>
{
// Here Orchard Core parts and handlers
})
.Configure(app =>
{
// Configure the Swagger only for Dev Env
if (app.ApplicationServices.GetRequiredService<IHostEnvironment>().IsDevelopment())
{
app.UseSwagger(c =>
{
// Configure Swagger path
c.RouteTemplate = "{tenant}/swagger/{documentName}/swagger.json";
});
app.UseSwaggerUI(c =>
{
// Configure Swagger UI path
c.SwaggerEndpoint("v1.0.0/swagger.json", "Librostore Payments API v1.0.0");
c.RoutePrefix = "swagger"; // Swagger UI is accessible on {tenant}/swagger/index.html
});
}
});
var app = builder.Build();
[...] The reason why I need to disable the swagger page, is because my API are used only by other microservices, and I don't need to provide the swagger to the final user. Maybe I can create a project swagger module in my solution, copying the OrchardCoreContrib.Apis.Swagger, and use Thank you |
Hi Everyone,
I installed the
OrchardCoreContrib.Apis.Swagger
version 1.5.0. In my Orchard Core 2.0.1 I have enabled the featuresQueries
andSQL Queries
, and I saw in the Swagger UI aQueryApi
section with two endpoints exposed.Thank you
The text was updated successfully, but these errors were encountered: