Skip to content

Commit 0aeb52f

Browse files
updates
1 parent 03adaa6 commit 0aeb52f

File tree

5 files changed

+12
-13
lines changed

5 files changed

+12
-13
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"ghcr.io/devcontainers/features/common-utils:2": {},
1616
"ghcr.io/devcontainers/features/dotnet:2": {
1717
"version": "none",
18-
"dotnetRuntimeVersions": "9.0",
19-
"aspNetCoreRuntimeVersions": "9.0"
18+
"dotnetRuntimeVersions": "8.0",
19+
"aspNetCoreRuntimeVersions": "8.0"
2020
}
2121
},
2222
"customizations": {

SampleApp/BackEnd/BackEnd.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.2" />
12-
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.3.1" />
11+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.*" />
12+
<PackageReference Include="Scalar.AspNetCore" Version="2.0.*" />
1313
</ItemGroup>
1414

1515
</Project>

SampleApp/BackEnd/Program.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
var builder = WebApplication.CreateBuilder(args);
22

33
// Add services to the container.
4-
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
5-
builder.Services.AddEndpointsApiExplorer();
6-
builder.Services.AddSwaggerGen();
4+
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
5+
builder.Services.AddOpenApi();
76

87
var app = builder.Build();
98

109
// Configure the HTTP request pipeline.
1110
if (app.Environment.IsDevelopment())
1211
{
13-
app.UseSwagger();
14-
app.UseSwaggerUI();
12+
app.MapOpenApi();
13+
app.MapScalarApiReference();
1514
}
1615

16+
app.UseHttpsRedirection();
17+
1718
var summaries = new[]
1819
{
1920
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
@@ -31,8 +32,7 @@
3132
.ToArray();
3233
return forecast;
3334
})
34-
.WithName("GetWeatherForecast")
35-
.WithOpenApi();
35+
.WithName("GetWeatherForecast");
3636

3737
app.Run();
3838

images/Swagger.png

-109 KB
Binary file not shown.

readme.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Want to try out the latest performance improvements coming with .NET 8 for web development?
44

5-
This repo builds a Weather API using .NET APIs, opens Swagger so you can call and test the API, and displays the data in a web application using Blazor with .NET.
5+
This repo builds a Weather API and displays the data in a web application using Blazor with .NET.
66

77
We've given you both a frontend and backend to play around with and where you go from here is up to you!
88

@@ -27,7 +27,6 @@ You can also run this repository locally by following these instructions:
2727
3. The Blazor web app and Swagger tabs should now be open on your browser. On Swagger, click "Try it out" and "Execute" to call and test the API.
2828

2929
![](images/BlazorApp.png)
30-
![](images/Swagger.png)
3130

3231

3332
4. **🔄 Iterate quickly:** Codespaces updates the server on each save, and VS Code's debugger lets you dig into the code execution.

0 commit comments

Comments
 (0)