DeepDrftWeb startup & setup
This commit is contained in:
@@ -4,6 +4,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeepDrftWeb", "DeepDrftWeb\
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeepDrftWeb.Client", "DeepDrftWeb\DeepDrftWeb.Client\DeepDrftWeb.Client.csproj", "{E76D21B4-308B-487B-B8D6-59D6AE49F1F7}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeepDrftModels", "DeepDrftModels\DeepDrftModels.csproj", "{10CE5160-16C3-4CB1-9E2E-52467BA80B4B}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeepDrftContent", "DeepDrftContent\DeepDrftContent.csproj", "{C79AFD08-02C0-45D2-A98A-FCDDFBEAE155}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetBlocks", "C:\lib\NetBlocks\NetBlocks.csproj", "{EEB3A665-B8AD-4C00-A41E-B9D8AFE1BBA8}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -18,5 +24,17 @@ Global
|
||||
{E76D21B4-308B-487B-B8D6-59D6AE49F1F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E76D21B4-308B-487B-B8D6-59D6AE49F1F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E76D21B4-308B-487B-B8D6-59D6AE49F1F7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{10CE5160-16C3-4CB1-9E2E-52467BA80B4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{10CE5160-16C3-4CB1-9E2E-52467BA80B4B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{10CE5160-16C3-4CB1-9E2E-52467BA80B4B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{10CE5160-16C3-4CB1-9E2E-52467BA80B4B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C79AFD08-02C0-45D2-A98A-FCDDFBEAE155}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C79AFD08-02C0-45D2-A98A-FCDDFBEAE155}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C79AFD08-02C0-45D2-A98A-FCDDFBEAE155}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C79AFD08-02C0-45D2-A98A-FCDDFBEAE155}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{EEB3A665-B8AD-4C00-A41E-B9D8AFE1BBA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EEB3A665-B8AD-4C00-A41E-B9D8AFE1BBA8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EEB3A665-B8AD-4C00-A41E-B9D8AFE1BBA8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EEB3A665-B8AD-4C00-A41E-B9D8AFE1BBA8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
using DeepDrftWeb;
|
||||
using MudBlazor.Services;
|
||||
using DeepDrftWeb.Client.Pages;
|
||||
using DeepDrftWeb.Components;
|
||||
using DeepDrftWeb.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add MudBlazor services
|
||||
builder.Services.AddMudServices();
|
||||
|
||||
Startup.ConfigureDomainServices(builder);
|
||||
|
||||
|
||||
builder.Services.AddControllers();
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddRazorComponents()
|
||||
.AddInteractiveServerComponents()
|
||||
@@ -24,14 +31,13 @@ else
|
||||
app.UseExceptionHandler("/Error", createScopeForErrors: true);
|
||||
// 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.UseHttpsRedirection();
|
||||
|
||||
|
||||
app.UseAntiforgery();
|
||||
|
||||
app.MapStaticAssets();
|
||||
app.MapControllers();
|
||||
app.MapRazorComponents<App>()
|
||||
.AddInteractiveServerRenderMode()
|
||||
.AddInteractiveWebAssemblyRenderMode()
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
using DeepDrftWeb.Data;
|
||||
using DeepDrftWeb.Data.Repositories;
|
||||
using DeepDrftWeb.Services;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace DeepDrftWeb;
|
||||
|
||||
public static class Startup
|
||||
{
|
||||
public static void ConfigureDomainServices(WebApplicationBuilder builder)
|
||||
{
|
||||
// Add Entity Framework services
|
||||
builder.Services.AddDbContext<DeepDrftContext>(options =>
|
||||
options.UseSqlite(builder.Configuration.GetConnectionString("DefaultConnection")));
|
||||
|
||||
// Add Track services
|
||||
builder.Services.AddScoped<TrackRepository>();
|
||||
builder.Services.AddScoped<TrackService>();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5,5 +5,8 @@
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Data Source=deepdrft.db"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user