22 lines
512 B
C#
22 lines
512 B
C#
using Microsoft.EntityFrameworkCore;
|
|
|
|
using Server;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
builder.Services.AddControllers();
|
|
builder.Services.AddDbContextPool<SpaceRaceDbContext>(options => {
|
|
options.UseNpgsql(
|
|
builder.Configuration.GetConnectionString("SpaceRace"),
|
|
assembly => assembly.MigrationsAssembly(typeof(SpaceRaceDbContext).Assembly.FullName)
|
|
);
|
|
});
|
|
|
|
var app = builder.Build();
|
|
|
|
app.UseHttpsRedirection();
|
|
app.UseAuthorization();
|
|
app.MapControllers();
|
|
|
|
app.Run();
|