-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
28 lines (21 loc) · 706 Bytes
/
Program.cs
File metadata and controls
28 lines (21 loc) · 706 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
// //creates webapp builder
// var builder = WebApplication.CreateBuilder(args);
// //adds controllers that handle web requests, or apis and so
// builder.Services.AddControllers();
// //builds the app
// var app = builder.Build();
// //maps the controllers to the app
// app.MapControllers();
// //runs the app
// app.Run();
using WeatherApiWrapper.Services;
var builder = WebApplication.CreateBuilder(args);
builder.WebHost.ConfigureKestrel(serverOptions =>
{
serverOptions.ListenAnyIP(80); // must match containerPort in YAML
});
builder.Services.AddControllers();
builder.Services.AddHttpClient<WeatherService>(); // Add this line
var app = builder.Build();
app.MapControllers();
app.Run();