-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
30 lines (23 loc) · 722 Bytes
/
Copy pathProgram.cs
File metadata and controls
30 lines (23 loc) · 722 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
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Morpheus.Dashboard;
using Morpheus.Extensions;
using Morpheus.Utilities;
Env.Load(".env");
DashboardApiOptions dashboardOptions = DashboardApiOptions.FromEnvironment();
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
builder.WebHost.UseUrls(dashboardOptions.Urls);
builder.Services
.AddBotServices()
.AddBotJobs()
.AddBotHandlers()
.AddBotDatabase()
.AddDashboardApi(dashboardOptions);
WebApplication app = builder.Build();
app.UseCors();
app.UseOutputCache();
app.MapDashboardApi();
app.RunStartupMigrations();
await app.StartBotAsync();
await app.RunAsync();