-
-
Save justinyoo/ecac896f16c0e57fbfea79a702d7317b to your computer and use it in GitHub Desktop.
Testing Azure Functions
This file contains 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.Net; | |
static ServiceLocator locator = new ServiceLocator(); | |
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log) | |
{ | |
log.Info($"C# HTTP trigger function processed a request. RequestUri={req.RequestUri}"); | |
var service = locator.GetService(); | |
var status = locator.GetStatus(); | |
service.Process(req); | |
status.Status = "Processed"; | |
var res = new HttpResponseMessage(HttpStatusCode.OK) { Content = req.Content }; | |
return await Task.FromResult(res); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment