-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathProgram.cs
More file actions
36 lines (28 loc) · 931 Bytes
/
Program.cs
File metadata and controls
36 lines (28 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using Ivy;
using Microsoft.Extensions.Configuration;
var server = new Server();
server.UseHotReload();
server.AddConnectionsFromAssembly();
server.AddAppsFromAssembly();
var settings = new AppShellSettings()
.UseTabs(preventDuplicates: true)
.DefaultApp<ClerkExample.MainApp>();
server.UseAppShell(settings);
server.SetMetaTitle("Clerk Example");
server.UseConfiguration(config =>
{
if (ProcessHelper.IsProduction())
{
var secretsPath = Environment.GetEnvironmentVariable("IVY_CLERK_SECRETS_PATH");
if (!string.IsNullOrEmpty(secretsPath))
{
if (!File.Exists(secretsPath))
{
throw new FileNotFoundException(
$"Clerk secrets file not found at path specified by IVY_CLERK_SECRETS_PATH: '{secretsPath}'");
}
config.AddJsonFile(secretsPath, optional: false);
}
}
});
await server.RunAsync();