2020-04-12 01:37:24 +02:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Threading.Tasks;
|
2020-07-02 09:15:33 +02:00
|
|
|
using Blazored.Modal;
|
2020-04-12 01:37:24 +02:00
|
|
|
using Microsoft.AspNetCore.Builder;
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
using Microsoft.AspNetCore.Hosting;
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.Hosting;
|
2020-04-12 20:01:46 +02:00
|
|
|
using Seenginx.Services;
|
2020-04-19 03:04:46 +02:00
|
|
|
using Seenginx.Services.Models;
|
2020-04-12 01:37:24 +02:00
|
|
|
|
|
|
|
namespace Seenginx
|
|
|
|
{
|
|
|
|
public class Startup
|
|
|
|
{
|
|
|
|
public Startup(IConfiguration configuration)
|
|
|
|
{
|
|
|
|
Configuration = configuration;
|
|
|
|
}
|
|
|
|
|
|
|
|
public IConfiguration Configuration { get; }
|
|
|
|
|
|
|
|
public void ConfigureServices(IServiceCollection services)
|
|
|
|
{
|
2020-04-13 00:21:36 +02:00
|
|
|
services.AddRazorPages()
|
|
|
|
#if DEBUG
|
|
|
|
.AddRazorRuntimeCompilation()
|
|
|
|
#endif
|
|
|
|
;
|
2020-04-12 01:37:24 +02:00
|
|
|
services.AddServerSideBlazor();
|
2020-07-02 09:15:33 +02:00
|
|
|
services.AddBlazoredModal();
|
2020-04-24 21:27:44 +02:00
|
|
|
|
2020-04-19 03:04:46 +02:00
|
|
|
var configPaths = new ConfigPaths();
|
2020-04-24 00:18:16 +02:00
|
|
|
configPaths.NginxPath = @"C:\nginx\";
|
2020-04-19 03:04:46 +02:00
|
|
|
configPaths.SystemDPath = @"C:\systemd\system\";
|
|
|
|
|
|
|
|
services.AddSingleton(configPaths);
|
2020-04-13 00:21:36 +02:00
|
|
|
services.AddTransient<IDmesgService, DmesgService>();
|
|
|
|
services.AddTransient<INginxService, NginxService>();
|
|
|
|
services.AddTransient<ISystemDService, SystemDService>();
|
2020-04-12 01:37:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
|
|
|
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
|
|
|
{
|
|
|
|
if (env.IsDevelopment())
|
|
|
|
{
|
|
|
|
app.UseDeveloperExceptionPage();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
app.UseExceptionHandler("/Error");
|
|
|
|
}
|
|
|
|
|
|
|
|
app.UseStaticFiles();
|
|
|
|
|
|
|
|
app.UseRouting();
|
2020-04-24 00:18:16 +02:00
|
|
|
|
2020-04-12 20:01:46 +02:00
|
|
|
app.UseAuthentication();
|
2020-04-12 01:37:24 +02:00
|
|
|
|
|
|
|
app.UseEndpoints(endpoints =>
|
|
|
|
{
|
|
|
|
endpoints.MapBlazorHub();
|
|
|
|
endpoints.MapFallbackToPage("/_Host");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|