Notes/Program.cs

32 lines
637 B
C#
Raw Normal View History

2023-01-25 13:48:50 +00:00
using BinaryDad.Notes;
2023-01-05 15:32:21 +00:00
using BinaryDad.Notes.Services;
2022-11-29 15:14:15 +00:00
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllersWithViews();
2023-01-25 13:48:50 +00:00
builder.Services.AddSignalR();
2023-01-05 15:32:21 +00:00
builder.Services.AddSingleton<INoteService, FileNoteService>();
2022-11-29 15:14:15 +00:00
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
2023-01-09 21:56:30 +00:00
app.UseHttpsRedirection();
2022-11-29 15:14:15 +00:00
}
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
2023-01-25 13:48:50 +00:00
app.MapHub<NoteHub>("/noteHub");
2022-11-29 15:14:15 +00:00
app.Run();