1
votes

This is the stock node app from Microsoft Documentation. Just followed instructions here -> https://docs.microsoft.com/en-us/azure/app-service/app-service-web-get-started-nodejs

All it has in index.js is this

var http = require('http');
var server = http.createServer(function(request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.end("Hello World!");
});
var port = process.env.PORT || 1337;
server.listen(port);
console.log("Server running at http://localhost:%d", port);

App runs ok on local machine and give expected output.

Only when I host on Azure and access the app, my response looks like this

 e
 Hellooo World!
 0

If I change the 'Hello World!' to some other string,

the 'e' part of response changes along with the string. The 0 stays.

Any idea why I'm getting the extra lines above and below the hello world line?

1
It has to be a setting external to my app. I just redeployed the same zip to two of my web apps and this one still has the issue. Only change was that I used CLI to create all resources for one app and manually created the other. The manual one has something wrong with the setup I guess - Stubborn

1 Answers

1
votes

Answering my own question -

I had "application insights" turned on in the app I manually created. That was causing the extra characters in output. Turned that off and everything is fine