|
|
@ -1,9 +1,7 @@
|
|
|
|
using cat_cafe.Repositories;
|
|
|
|
using cat_cafe.Repositories;
|
|
|
|
using cat_cafe.WeSo;
|
|
|
|
using cat_cafe.WeSo;
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
using Serilog;
|
|
|
|
|
|
|
|
using System.Net.WebSockets;
|
|
|
|
using System.Net.WebSockets;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
|
|
|
|
|
|
|
@ -12,7 +10,7 @@ List<WebSocket> _sockets = new();
|
|
|
|
// Add services to the container.
|
|
|
|
// Add services to the container.
|
|
|
|
|
|
|
|
|
|
|
|
builder.Services.AddLogging(configure => configure.AddFile("log.txt"));
|
|
|
|
builder.Services.AddLogging(configure => configure.AddFile("log.txt"));
|
|
|
|
builder.Services.AddSingleton<List<WebSocket>>(x => _sockets);
|
|
|
|
builder.Services.AddSingleton(x => _sockets);
|
|
|
|
builder.Services.AddSingleton<WebSocketHandler>();
|
|
|
|
builder.Services.AddSingleton<WebSocketHandler>();
|
|
|
|
builder.Services.AddControllers();
|
|
|
|
builder.Services.AddControllers();
|
|
|
|
builder.Services.AddDbContext<CatCafeContext>(opt => opt.UseSqlite("Data Source=cat_cafe.db"));
|
|
|
|
builder.Services.AddDbContext<CatCafeContext>(opt => opt.UseSqlite("Data Source=cat_cafe.db"));
|
|
|
|