server init
This commit is contained in:
1 parent
893155b53d
commit
e7be495f7f
14 files changed
+213
-6
No files matched your search
@@ -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();
|
||||
Reference in new issue
Block a user