Created
December 9, 2018 14:09
-
-
Save subhendu-de/11e4d3dba7bd0e30dc411b6ae2748481 to your computer and use it in GitHub Desktop.
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
using Swashbuckle.AspNetCore.Swagger; | |
namespace eKart.Api | |
{ | |
public class Startup | |
{ | |
// This method gets called by the runtime. Use this method to add services to the container. | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
// Register the Swagger generator, defining 1 or more Swagger documents | |
services.AddSwaggerGen(c => | |
{ | |
c.SwaggerDoc("v1", new Info { Title = "eKart API", Version = "v1" }); | |
}); | |
} | |
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. | |
public void Configure(IApplicationBuilder app, IHostingEnvironment env) | |
{ | |
// Enable middleware to serve generated Swagger as a JSON endpoint. | |
app.UseSwagger(); | |
// Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.), | |
// specifying the Swagger JSON endpoint. | |
app.UseSwaggerUI(c =>; | |
{ | |
c.SwaggerEndpoint("/swagger/v1/swagger.json", "eKart V1"); | |
}); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment