Add Azure function app project with test function
This commit is contained in:
23
BeauFindlay/src/BeauFindlay.Client/Pages/Contact.razor
Normal file
23
BeauFindlay/src/BeauFindlay.Client/Pages/Contact.razor
Normal file
@@ -0,0 +1,23 @@
|
||||
@page "/contact"
|
||||
|
||||
@inject HttpClient HttpClient
|
||||
|
||||
@if (!string.IsNullOrWhiteSpace(apiResponse))
|
||||
{
|
||||
<p class="text-2xl">Response from Azure Function API: @apiResponse</p>
|
||||
}
|
||||
|
||||
@code {
|
||||
private string apiResponse = "";
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
var response = await HttpClient.GetStringAsync("/api/Function1");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(response))
|
||||
{
|
||||
apiResponse = response;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user