Add project files.

This commit is contained in:
user
2026-05-13 21:51:16 +02:00
parent 9bba670e7a
commit 7e8c24333e
11 changed files with 278 additions and 0 deletions

45
practise-05/Program.cs Normal file
View File

@@ -0,0 +1,45 @@
namespace practise_05
{
public class Program
{
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
builder.Services.AddOpenApi();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseAuthorization();
app.UseCors(x =>
{
x.AllowCredentials();
x.WithOrigins("http://127.0.0.1:5500");
x.AllowAnyMethod();
x.AllowAnyHeader();
});
app.MapControllers();
app.Run();
}
}
}