Dotnet version upgrade
This commit is contained in:
26
Program.cs
26
Program.cs
@@ -1,25 +1,13 @@
|
||||
using Hangfire;
|
||||
using Hangfire.MemoryStorage;
|
||||
using MauMau_Server.Room;
|
||||
using MauMau_Server.Websockets;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
var services = builder.Services;
|
||||
services.AddControllers();
|
||||
builder.Services.AddControllers();
|
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
services.AddEndpointsApiExplorer();
|
||||
services.AddSwaggerGen();
|
||||
services.AddScoped<IRoomManager, RoomManager>();
|
||||
// var roomManager = services.BuildServiceProvider().GetRequiredService<IRoomManager>();
|
||||
//
|
||||
// services.AddHangfire((sp, config) =>
|
||||
// {
|
||||
// config.UseRecommendedSerializerSettings();
|
||||
// config.UseMemoryStorage();
|
||||
// });
|
||||
// services.AddHangfireServer();
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
builder.Services.AddScoped<IRoomManager, RoomManager>();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
@@ -37,9 +25,6 @@ var webSocketOptions = new WebSocketOptions()
|
||||
|
||||
app.UseWebSockets(webSocketOptions);
|
||||
|
||||
// var recurringJobManager = app.Services.GetRequiredService<IRecurringJobManagerV2>();
|
||||
// recurringJobManager.AddOrUpdate("1", () => roomManager.ClearGhostRooms(), Cron.Hourly);
|
||||
|
||||
app.UseCors(policyBuilder =>
|
||||
{
|
||||
policyBuilder.AllowAnyOrigin();
|
||||
@@ -48,6 +33,5 @@ app.UseCors(policyBuilder =>
|
||||
});
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
app.UseAuthorization();
|
||||
app.MapControllers();
|
||||
app.Run();
|
||||
app.Run();
|
||||
|
||||
Reference in New Issue
Block a user