Skip to content

Instantly share code, notes, and snippets.

@ankitvijay
Last active January 15, 2020 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ankitvijay/5a52b16d4d612258549d4644881aae35 to your computer and use it in GitHub Desktop.
Save ankitvijay/5a52b16d4d612258549d4644881aae35 to your computer and use it in GitHub Desktop.
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