-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
35 lines (24 loc) · 833 Bytes
/
Copy pathProgram.cs
File metadata and controls
35 lines (24 loc) · 833 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
using FolderCreatorApi.Endpoints;
using FolderCreatorApi.Models;
using System.Text.Json;
using System.Xml.Linq;
using FolderCreatorApi.Services;
using FolderCreatorApi.Components;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddSingleton<FolderService>();
builder.Services.AddScoped<FileStorageService>();
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
var app = builder.Build();
var outputRoot = Environment.GetEnvironmentVariable("OUTPUT_ROOT") ?? "/data/builds";
Directory.CreateDirectory(outputRoot);
app.UseSwagger();
app.UseSwaggerUI();
app.UseStaticFiles();
app.UseAntiforgery();
app.MapFolderEndpoints();
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();
app.Run();