This repository has been archived on 2023-06-01. You can view files and clone it, but cannot push or open issues or pull requests.
discord-bot-shtik/Program.cs

28 lines
793 B
C#
Raw Normal View History

2023-07-04 20:40:37 -04:00
using Microsoft.EntityFrameworkCore;
using vassago.Models;
2023-07-03 12:51:23 -04:00
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllersWithViews();
builder.Services.AddSingleton<IHostedService, vassago.ConsoleService>();
2023-07-04 20:40:37 -04:00
builder.Services.AddDbContext<ChattingContext>(options =>
options.UseNpgsql(builder.Configuration.GetConnectionString("ChattingContext") ),ServiceLifetime.Transient);
2023-07-03 12:51:23 -04:00
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Home/Error");
}
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
app.Run();