Skip to content

Commit

Permalink
Activate Swagger endpoint (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
kbeaugrand authored Feb 11, 2022
1 parent 0078fab commit e3322ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.14.0" />
<PackageReference Include="MudBlazor" Version="6.0.6" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 8 additions & 0 deletions src/AzureIoTHub.Portal/Server/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,13 @@ public void ConfigureServices(IServiceCollection services)
client.BaseAddress = new Uri(configuration.LoRaRegionRouterConfigUrl);
}).AddPolicyHandler(transientHttpErrorPolicy);

services.AddControllers();

services.AddEndpointsApiExplorer();

services.AddApplicationInsightsTelemetry();

services.AddSwaggerGen();
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
Expand All @@ -134,6 +140,8 @@ public async void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseDeveloperExceptionPage();
app.UseWebAssemblyDebugging();
app.UseSwagger();
app.UseSwaggerUI();
}
else
{
Expand Down

0 comments on commit e3322ce

Please sign in to comment.