Notes/Program.cs

31 lines
740 B
C#
Raw Normal View History

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-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())
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
app.Run();