parent
35cdc15f32
commit
fcdff5d566
@ -1,25 +1,18 @@ |
|||||||
var builder = WebApplication.CreateBuilder(args); |
namespace Api |
||||||
|
{ |
||||||
// Add services to the container. |
public static class Program |
||||||
|
{ |
||||||
builder.Services.AddControllers(); |
public static void Main(string[] args) |
||||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle |
|
||||||
builder.Services.AddEndpointsApiExplorer(); |
|
||||||
builder.Services.AddSwaggerGen(); |
|
||||||
|
|
||||||
var app = builder.Build(); |
|
||||||
|
|
||||||
// Configure the HTTP request pipeline. |
|
||||||
if (app.Environment.IsDevelopment()) |
|
||||||
{ |
{ |
||||||
app.UseSwagger(); |
CreateHostBuilder(args).Build().Run(); |
||||||
app.UseSwaggerUI(); |
|
||||||
} |
} |
||||||
|
|
||||||
app.UseHttpsRedirection(); |
public static IHostBuilder CreateHostBuilder(string[] args) => |
||||||
|
Host.CreateDefaultBuilder(args) |
||||||
app.UseAuthorization(); |
.ConfigureWebHostDefaults(webBuilder => |
||||||
|
{ |
||||||
app.MapControllers(); |
|
||||||
|
|
||||||
app.Run(); |
webBuilder.UseStartup<Startup>(); |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
||||||
|
Loading…
Reference in new issue