28 lines
728 B
C#
28 lines
728 B
C#
|
using Microsoft.OpenApi.Models;
|
||
|
|
||
|
var builder = WebApplication.CreateBuilder(args);
|
||
|
|
||
|
// Add services to the container.
|
||
|
|
||
|
builder.Services.AddControllers();
|
||
|
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||
|
builder.Services.AddEndpointsApiExplorer();
|
||
|
builder.Services.AddSwaggerGen(x => x.SwaggerDoc("v1", new OpenApiInfo { Title = "ServiceSourceRestAPI", Version = "v1" }));
|
||
|
|
||
|
var app = builder.Build();
|
||
|
|
||
|
// Configure the HTTP request pipeline.
|
||
|
if (app.Environment.IsDevelopment()) {
|
||
|
app.UseSwagger();
|
||
|
app.UseSwaggerUI(x => x.SwaggerEndpoint("/swagger/v1/swagger.json", "ServiceSourceRestAPI v1"));
|
||
|
}
|
||
|
|
||
|
app.UseHttpsRedirection();
|
||
|
|
||
|
app.UseAuthorization();
|
||
|
|
||
|
app.MapControllers();
|
||
|
|
||
|
app.Run();
|
||
|
|