server init

This commit is contained in:
ntr committed 2023-08-23 12:56:28 +10:00
1 parent 893155b53d
commit e7be495f7f
14 files changed
+213 -6

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
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();