-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathProgram.cs
More file actions
35 lines (29 loc) · 949 Bytes
/
Program.cs
File metadata and controls
35 lines (29 loc) · 949 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 System.Text.Json;
using IsolatedFunctionApps.Middleware;
using IsolatedFunctionApps.Services;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace IsolatedFunctionApps
{
public class Program
{
public static void Main()
{
var host = new HostBuilder()
.ConfigureFunctionsWorkerDefaults(builder=>
{
builder.Services.Configure<JsonSerializerOptions>(options =>
{
options.AllowTrailingCommas = true;
});
builder.UseMiddleware<ExceptionMiddleWare>();
})
.ConfigureServices(serviceCollection =>
{
serviceCollection.AddSingleton<IMockDataService>(new MockDataService());
})
.Build();
host.Run();
}
}
}