public static async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
            ILogger log)
        {
            try
            {
                XkcdDataCollector collector = new XkcdDataCollector();
                var result = await collector.GetLatestComic();

                return((ActionResult) new OkObjectResult(result));
            }
            catch (Exception ex)
            {
                log.LogError(ex, "GetLatestComic failed");
                return(new StatusCodeResult(500));
            }
        }
        public static async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
            ILogger log)
        {
            try
            {
                string comicId = await ParameterManager.GetParameterValue(req, "comicId", (d) => d?.comicId);

                comicId = ParameterManager.SanitizeParameter(comicId, ParameterManager.ParameterType.Numeric, "");

                XkcdDataCollector collector = new XkcdDataCollector();
                var result = await collector.GetComicInformation(comicId);

                return(new OkObjectResult(result));
            }
            catch (Exception ex)
            {
                log.LogError(ex, "GetComicInformation failed");
                return(new StatusCodeResult(500));
            }
        }