Skip to content

Commit c190256

Browse files
author
Anh Thi Dao
committed
modify the route to display username and date
1 parent 7d0e20d commit c190256

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Http/samples/MinimalSample/Program.cs

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

19-
var message =
20-
$"""
19+
app.MapGet("/", () => $"""
2120
Operating System: {Environment.OSVersion}
2221
.NET version: {Environment.Version}
23-
""";
24-
25-
app.MapGet("/", () => message);
22+
Username: {Environment.UserName}
23+
Date and Time: {DateTime.Now}
24+
""");
2625

2726
var nestedGroup = app.MapGroup("/group/{groupName}")
2827
.MapGroup("/nested/{nestedName}")

0 commit comments

Comments
 (0)