예제 #1
0
        public static async Task <HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequestMessage req, TraceWriter log)
        {
            try
            {
                log.Info("C# HTTP trigger function processed a request.");
                var firstGen = await Generations.GetFirstGenerationAsync(log);

                IndexService.IndexCollection(firstGen, "firstgeneration");
                return(req.CreateResponse(HttpStatusCode.OK, "Indexing completed!"));
            }
            catch (Exception ex)
            {
                log.Error(ex.Message);
                return(req.CreateResponse(HttpStatusCode.BadRequest, ex.Message));
            }
        }