PhoneToolMX/PolyProv/Program.cs
snow flurry eff2dda7a4 Add PolyProv
Dynamic configuration for Polycom (VVX?) phones.
2023-10-20 12:58:23 -07:00

36 lines
867 B
C#

using Microsoft.EntityFrameworkCore;
using PhoneToolMX.Data;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllersWithViews();
builder.Services.AddDbContext<PTMXContext>(
options => options.UseNpgsql(builder.Configuration.GetConnectionString("DbConnection"),
b => b.MigrationsAssembly("PhoneToolMX.Models")));
builder.Services.AddDatabaseDeveloperPageExceptionFilter();
if (!builder.Environment.IsDevelopment()) {
builder.Host.UseSystemd();
}
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: "{action}",
defaults: new { controller = "Config" });
app.Run();