Last active
January 15, 2020 21:19
-
-
Save ankitvijay/5a52b16d4d612258549d4644881aae35 to your computer and use it in GitHub Desktop.
Swagger Before Header Startup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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