Skip to content

Instantly share code, notes, and snippets.

@vainolo
Created October 25, 2018 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vainolo/32fa52fafd22e9ff46408dff23963b03 to your computer and use it in GitHub Desktop.
Save vainolo/32fa52fafd22e9ff46408dff23963b03 to your computer and use it in GitHub Desktop.
Azure Functions – Part 2: Serving HTML Pages with Azure Functions - Option 2
// Option 2, read from local file
var response = new HttpResponseMessage(HttpStatusCode.OK);
var stream = new FileStream(@"d:\home\site\wwwroot\HelloWorldHTML\hello.html", FileMode.Open);
response.Content = new StreamContent(stream);
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