I have a node azure function with the function.json like this:
{
"disabled": false,
"bindings": [
{
"name": "req",
"type": "httpTrigger",
"direction": "in",
"methods": [ "get" ]
},
{
"name": "res",
"type": "http",
"direction": "out"
}
]
}
module.exports = function (context, sentimentTable) {
context.res = {
body: "<!DOCTYPE html> <html> <head> </head> <body> Hello World </body> </html>",
contentType: "text/html"
};
context.done();
};
Must be 'Content-Type' and you specify headers this way
context.res = {
body: '...',
headers: {
'Content-Type': 'text/html; charset=utf-8'
}
}
See this blog post on AzureServerless.com - http://azureserverless.com/2016/11/12/a-html-nanoserver/