mirror of
https://github.com/opelly27/WinStudentGoalTracker.git
synced 2026-05-20 09:57:37 +00:00
31 lines
620 B
C#
31 lines
620 B
C#
using WinStudentGoalTracker.Api.Configuration;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
ConfigHelper.Configuration = builder.Configuration;
|
|
|
|
builder.Services.AddControllers();
|
|
builder.Services.AddEndpointsApiExplorer();
|
|
builder.Services.AddSwaggerGen();
|
|
builder.Services.AddCors(options =>
|
|
{
|
|
options.AddDefaultPolicy(policy =>
|
|
{
|
|
policy.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader();
|
|
});
|
|
});
|
|
|
|
var app = builder.Build();
|
|
|
|
if (app.Environment.IsDevelopment())
|
|
{
|
|
app.UseSwagger();
|
|
app.UseSwaggerUI();
|
|
}
|
|
|
|
app.UseCors();
|
|
app.UseHttpsRedirection();
|
|
app.MapControllers();
|
|
|
|
app.Run();
|