Created
May 14, 2019 07:48
-
-
Save vmandic/394d6705c522d4eee7d649f61e758464 to your computer and use it in GitHub Desktop.
meds-processor, part/4, snippet #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Text; | |
using MedsProcessor.WebAPI.Infrastructure; | |
using Microsoft.AspNetCore.Mvc; | |
namespace MedsProcessor.WebAPI.Controllers | |
{ | |
public class HomeController : ApiControllerBase | |
{ | |
static bool isFirstTimeRun = true; | |
/// <summary> | |
/// Displays initial information about the Web API. | |
/// </summary> | |
/// <returns>Returns a JSON formatted message with basic Web API info.</returns> | |
[HttpGet("~/")] | |
public ActionResult<ApiMessageResponse> Index() | |
{ | |
var statusUrl = Url.RouteUrl("Processor_GetStatus"); | |
var sb = new StringBuilder(); | |
sb.Append(isFirstTimeRun ? | |
"The HZZO meds-processor has started with the Web API launch!" : | |
"Welcome to the HZZO meds-processor.") | |
.Append($" You can check the status at: { statusUrl }"); | |
isFirstTimeRun = false; | |
return ApiResponse.ForMessage(sb.ToString()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment