Created
October 25, 2018 13:02
-
-
Save vainolo/bd6ab640d609bebb848e8e9d6f4f40b1 to your computer and use it in GitHub Desktop.
Azure Functions – Part 2: Serving HTML Pages with Azure Functions - Option 1
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; | |
using System.Net.Http.Headers; | |
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log) | |
{ | |
log.Info("C# HTTP trigger function processed a request."); | |
// Option 1, coded HTML | |
var response = req.CreateResponse(HttpStatusCode.OK, "Hello "); | |
response.Content.Headers.ContentType = new MediaTypeHeaderValue("text/html"); | |
return response; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment