@page "/servers" @attribute [StreamRendering] Servers

Servers

@if (servers == null) {

Loading...

} else { @foreach (var world in servers) { }
Id Name State
@world.Id @world.Name @world.State
} @code { private List? servers; protected override async Task OnInitializedAsync() { HttpClient httpClient = new HttpClient(); httpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue(Environment.GetEnvironmentVariable("ADMIN_KEY")); servers = await httpClient.GetFromJsonAsync>("http://localhost:8080/api/admin/servers"); } }