Burgyn / MMLib.SwaggerForOcelot

This repo contains swagger extension for ocelot.
MIT License
351 stars 93 forks source link

Renaming swagger gateway #193

Closed Arcalise08 closed 2 years ago

Arcalise08 commented 2 years ago

I'm unsure if this is a bug or if I'm simply using it wrong.

I'm trying to change the default /swagger prefix

I've tried all combinations of the following

app.UseSwaggerForOcelotUI(opt =>
{
    //opt.DownstreamSwaggerEndPointBasePath = "/my-prefix";
    //opt.PathToSwaggerGenerator = "my-prefix";
    //opt.ServerOcelot = "/my-prefix";    
    opt.RoutePrefix = "/my-prefix";
});

the RoutePrefix option seems like the one to use.

And going to localhost/my-prefix will redirect to localhost/my-prefix/index.html like it should, but I get a 404 error.

Burgyn commented 2 years ago

Hi,

try to use property RoutePrefix

app.UseSwaggerForOcelotUI(opt =>
{
    opt.RoutePrefix = "docs";
})

⚠ but be careful, no slash!

Arcalise08 commented 2 years ago

Hi,

try to use property RoutePrefix

app.UseSwaggerForOcelotUI(opt =>
{
    opt.RoutePrefix = "docs";
})

⚠ but be careful, no slash!

Thanks so much, Not sure why I hadnt tried that.