mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
refactor(directory): ♻ prefer lowercase API urls
This commit is contained in:
parent
8be0dba2a0
commit
9c09d51695
3 changed files with 9 additions and 8 deletions
|
|
@ -9,7 +9,7 @@
|
|||
<DockerServiceName>filterlists</DockerServiceName>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Include=".env.directory" />
|
||||
<None Include=".env" />
|
||||
<None Include="docker-compose.directory.migrations.tests.yml" />
|
||||
<None Include="docker-compose.override.yml">
|
||||
<DependentUpon>docker-compose.yml</DependentUpon>
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ public Startup(IConfiguration configuration)
|
|||
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddRouting(o => o.LowercaseUrls = true);
|
||||
services.AddControllers()
|
||||
.AddJsonOptions(o => o.JsonSerializerOptions.IgnoreNullValues = true);
|
||||
services.AddSwaggerGen();
|
||||
|
|
@ -29,7 +30,7 @@ public static void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
|||
if (env.IsDevelopment())
|
||||
app.UseDeveloperExceptionPage();
|
||||
app.UseRouting();
|
||||
app.UseEndpoints(e => { e.MapControllers(); });
|
||||
app.UseEndpoints(e => e.MapControllers());
|
||||
app.UseSwagger();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ internal static class SwaggerExtensions
|
|||
{
|
||||
public static void AddSwaggerGen(this IServiceCollection services)
|
||||
{
|
||||
services.AddSwaggerGen(c =>
|
||||
c.SwaggerDoc("v1", new OpenApiInfo
|
||||
services.AddSwaggerGen(o =>
|
||||
o.SwaggerDoc("v1", new OpenApiInfo
|
||||
{
|
||||
Title = "FilterLists Directory API",
|
||||
Description =
|
||||
|
|
@ -45,11 +45,11 @@ public static void UseSwagger(this IApplicationBuilder app)
|
|||
#endif
|
||||
});
|
||||
});
|
||||
app.UseSwaggerUI(c =>
|
||||
app.UseSwaggerUI(o =>
|
||||
{
|
||||
c.SwaggerEndpoint("v1/swagger.json", "FilterLists Directory API V1");
|
||||
c.DocumentTitle = "FilterLists Directory API";
|
||||
c.RoutePrefix = string.Empty;
|
||||
o.SwaggerEndpoint("v1/swagger.json", "FilterLists Directory API V1");
|
||||
o.DocumentTitle = "FilterLists Directory API";
|
||||
o.RoutePrefix = string.Empty;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue