-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
27 lines (23 loc) 路 704 Bytes
/
Copy pathProgram.cs
File metadata and controls
27 lines (23 loc) 路 704 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
锘縰sing DotNetEnv;
using RtspHlsRelay.Services;
using RtspHlsRelay.Middleware;
namespace RtspHlsRelay;
public class Program
{
public static void Main(string[] args)
{
Env.Load(".env");
if (Utils.HasMissingEnvVar(out string missingKey))
{
throw new Exception($"Missing environment variable: {missingKey}");
}
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddHostedService<FFMpegService>();
builder.Logging.ClearProviders().AddSimpleConsole();
builder.Logging.SetMinimumLevel(LogLevel.Warning);
var app = builder.Build();
app.UseMiddleware<RequestMiddleware>();
app.UseStaticFiles(Utils.GetStaticFileOptions());
app.Run("http://127.0.0.1:8080");
}
}