Skip to content

Instantly share code, notes, and snippets.

@ankitvijay

ankitvijay/Startup.cs

Last active Jan 15, 2020
Embed
What would you like to do?
Swagger Before Header Startup
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
services.AddSwaggerGen(options =>
{
options.SwaggerDoc("v1", new OpenApiInfo { Title = "My Awesome Application", Version = "v1" });
});
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseRouting();
app.UseSwagger();
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("v1/swagger.json", "My Awesome Application");
});
app.UseEndpoints(endpoints => {
endpoints.MapControllers();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment