Reputation: 5234
I created an app (Node.js + Express), run it locally. Then I created Node.js app at Azure and uploaded files through FTP. And then I stuck - how to run it?
I found kind of remote console in azure and installed all the packages from there. But when I tried to run the app: "npm start" I had only one line back: "Bad request". What does it mean? What to do with it?
The beginning of ./bin/www file:
var app = require('../app');
var debug = require('debug')('goWeb:server');
var http = require('http');
/**
* Get port from environment and store in Express.
*/
var port = normalizePort(process.env.PORT || '3000');
app.set('port', port);
/**
* Create HTTP server.
*/
var server = http.createServer(app);
/**
* Listen on provided port, on all network interfaces.
*/
server.listen(port);
server.on('error', onError);
server.on('listening', onListening);
goWeb - is my app, mentioned in package.js.
UPD I changed port to 80 and now I have the error "Port 80 requires elevated privileges". I have no idea what to do next. Thanks
Upvotes: 2
Views: 1121
Reputation: 9950
It seems that your app.js
file is not in wwwroot
folder where the content is served by the web server iisnode and you don't need to do npm start
in Azure web apps.
You can take a look at my wwwroot
structure, it looks like this:
You can also customize the path of the app.js
file with the following lines in web.config
.
<handlers>
<!-- Indicates that the app.js file is a node.js site to be handled by the iisnode module -->
<add name="iisnode" path="app.js" verb="*" modules="iisnode"/>
</handlers>
Upvotes: 1