File: Program.cs
Web Access
Project: src\tests\testproject\TestProject.ServiceA\TestProject.ServiceA.csproj (TestProject.ServiceA)
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
 
using Microsoft.AspNetCore.Hosting.Server;
using Microsoft.AspNetCore.Hosting.Server.Features;
 
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
 
app.MapGet("/", () => "Hello World!");
app.MapGet("/pid", () => Environment.ProcessId);
 
app.MapGet("/urls", (IServiceProvider sp) => sp.GetService<IServer>()?.Features?.Get<IServerAddressesFeature>()?.Addresses);
 
app.Run();