use the helper
This commit is contained in:
parent
69e81b9fd4
commit
aabbbc1fea
6 changed files with 13 additions and 18 deletions
5
.vscode/launch.json
vendored
5
.vscode/launch.json
vendored
|
|
@ -46,7 +46,10 @@
|
||||||
"name": "C#: Yavsc.Org Debug",
|
"name": "C#: Yavsc.Org Debug",
|
||||||
"type": "dotnet",
|
"type": "dotnet",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"projectPath": "${workspaceFolder}/src/Yavsc.Org/Yavsc.Org.csproj"
|
"projectPath": "${workspaceFolder}/src/Yavsc.Org/Yavsc.Org.csproj",
|
||||||
|
"env": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Yavsc.Org",
|
"name": "Yavsc.Org",
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ using Yavsc.Abstract.Interfaces;
|
||||||
using Yavsc.Helpers;
|
using Yavsc.Helpers;
|
||||||
using Yavsc.Interface;
|
using Yavsc.Interface;
|
||||||
using Yavsc.Models;
|
using Yavsc.Models;
|
||||||
|
using Yavsc.Server.Helpers;
|
||||||
using Yavsc.Services;
|
using Yavsc.Services;
|
||||||
|
|
||||||
internal class Program
|
internal class Program
|
||||||
|
|
@ -29,10 +30,7 @@ internal class Program
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
builder.Configuration
|
builder.AddConfiguration("api");
|
||||||
.AddJsonFile("appsettings-api.json", optional: false, reloadOnChange: false)
|
|
||||||
.AddJsonFile($"appsettings-api.{builder.Environment.EnvironmentName}.json", optional: false, reloadOnChange: false)
|
|
||||||
.AddEnvironmentVariables();
|
|
||||||
var services = builder.Services;
|
var services = builder.Services;
|
||||||
|
|
||||||
// Anthropic client
|
// Anthropic client
|
||||||
|
|
|
||||||
|
|
@ -29,10 +29,7 @@ internal class Program
|
||||||
Console.Title = "Yavsc.Blogs";
|
Console.Title = "Yavsc.Blogs";
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
builder.Configuration
|
builder.AddConfiguration("blogs");
|
||||||
.AddJsonFile("appsettings-blogs.json", optional: false, reloadOnChange: false)
|
|
||||||
.AddJsonFile($"appsettings-blogs.{builder.Environment.EnvironmentName}.json", optional: false, reloadOnChange: false)
|
|
||||||
.AddEnvironmentVariables();
|
|
||||||
|
|
||||||
var services = builder.Services;
|
var services = builder.Services;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using Anthropic.SDK;
|
using Anthropic.SDK;
|
||||||
using Yavsc.Abstract.Interfaces;
|
using Yavsc.Abstract.Interfaces;
|
||||||
using Yavsc.Extensions;
|
using Yavsc.Extensions;
|
||||||
|
using Yavsc.Server.Helpers;
|
||||||
|
|
||||||
namespace Yavsc
|
namespace Yavsc
|
||||||
{
|
{
|
||||||
|
|
@ -9,10 +10,7 @@ namespace Yavsc
|
||||||
public static async Task Main(string[] args)
|
public static async Task Main(string[] args)
|
||||||
{
|
{
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
builder.Configuration
|
builder.AddConfiguration("org");
|
||||||
.AddJsonFile("appsettings-org.json", optional: false, reloadOnChange: false)
|
|
||||||
.AddJsonFile($"appsettings-org.{builder.Environment.EnvironmentName}.json", optional: false, reloadOnChange: false)
|
|
||||||
.AddEnvironmentVariables();
|
|
||||||
var app = await builder
|
var app = await builder
|
||||||
.ConfigureWebAppServices()
|
.ConfigureWebAppServices()
|
||||||
.ConfigurePipeline();
|
.ConfigurePipeline();
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,8 @@ public static class ConfigHelpers
|
||||||
var rootConfig = builder.Configuration
|
var rootConfig = builder.Configuration
|
||||||
.AddJsonFile($"appsettings-{appName}.json", optional: false, reloadOnChange: false);
|
.AddJsonFile($"appsettings-{appName}.json", optional: false, reloadOnChange: false);
|
||||||
|
|
||||||
if (!String.IsNullOrWhiteSpace(builder.Environment.EnvironmentName))
|
|
||||||
rootConfig.AddJsonFile($"appsettings-{appName}.{builder.Environment.EnvironmentName}.json", optional: true, reloadOnChange: false);
|
rootConfig.AddJsonFile($"appsettings-{appName}.{builder.Environment.EnvironmentName}.json", optional: true, reloadOnChange: false);
|
||||||
;
|
|
||||||
return rootConfig.AddEnvironmentVariables();
|
return rootConfig.AddEnvironmentVariables();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -14,7 +14,7 @@ internal class Program
|
||||||
HostApplicationBuilder builder = Host.CreateApplicationBuilder(args);
|
HostApplicationBuilder builder = Host.CreateApplicationBuilder(args);
|
||||||
builder.Configuration
|
builder.Configuration
|
||||||
.AddJsonFile("appsettings-cli.json", optional: false, reloadOnChange: false)
|
.AddJsonFile("appsettings-cli.json", optional: false, reloadOnChange: false)
|
||||||
.AddJsonFile($"appsettings-cli.{builder.Environment.EnvironmentName}.json", optional: false, reloadOnChange: false)
|
.AddJsonFile($"appsettings-cli.{builder.Environment.EnvironmentName}.json", optional: true, reloadOnChange: false)
|
||||||
.AddEnvironmentVariables();
|
.AddEnvironmentVariables();
|
||||||
|
|
||||||
AppHost = builder.Build();
|
AppHost = builder.Build();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue