mirror of
https://github.com/farcasclaudiu/AzureStaticWebApp-CSharp-SimpleDemo.git
synced 2026-06-22 07:01:03 +03:00
voila an api
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
@page "/counter"
|
||||
@inject HttpClient Http
|
||||
|
||||
<h1>Counter</h1>
|
||||
|
||||
@@ -6,8 +7,18 @@
|
||||
|
||||
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
|
||||
|
||||
<p>Message: @message</p>
|
||||
|
||||
<button class="btn btn-primary" @onclick="GetMessage">Salutation</button>
|
||||
|
||||
@code {
|
||||
private int currentCount = 0;
|
||||
private string message = "Hi!";
|
||||
|
||||
private async Task GetMessage(){
|
||||
var temp = await Http.GetStringAsync("/api/JustHello?name=cloudies");
|
||||
message = temp;
|
||||
}
|
||||
|
||||
private void IncrementCount()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user