Skip to content

Commit 0d1a2a8

Browse files
BArthur1972Bethel Arthurhalter73
authored
Add a new route to sample app that display OS and .NET versions (#41901)
* Add a new route to sample app that display OS and .NET versions * Apply suggestions from code review Co-authored-by: Stephen Halter <halter73@gmail.com> Co-authored-by: Bethel Arthur <t-barthur@microsoft.com> Co-authored-by: Stephen Halter <halter73@gmail.com>
1 parent 1ae21a7 commit 0d1a2a8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Http/samples/MinimalSample/Program.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
string Plaintext() => "Hello, World!";
1717
app.MapGet("/plaintext", Plaintext);
1818

19+
var message =
20+
$"""
21+
Operating System: {Environment.OSVersion}
22+
.NET version: {Environment.Version}
23+
""";
24+
25+
app.MapGet("/", () => message);
26+
1927
var nestedGroup = app.MapGroup("/group/{groupName}")
2028
.MapGroup("/nested/{nestedName}")
2129
.WithMetadata(new TagsAttribute("nested"));

0 commit comments

Comments
 (0)