Open ghost opened 10 years ago
So I guess the command is now "$ node ./bin/www" ? Nodeclipse does have notation of Express project once it is created. How to impose that that command is to be used?
Running via npm is bad, as debugging becomes other issue #153
BTW I am busy with Android now, so I don't look into Node.js often.
I agree: $npm start
is not the correct way.
$ node ./bin/www
(node only once) is going to node.js more directly and it's documented in the new project's package.json in its start
section if the project was generated by express command line tool: that would be the correct way to go.
That would require parsing package.json in Java to get that value first.
For now adding ability to run www
file with Node.
BTW, just copy www
into start.js
like below and this is correct entry point
console.log('starting Express server');
var debug = require('debug')('NodeExpress43');
var app = require('./app');
app.set('port', process.env.PORT || 3000);
var server = app.listen(app.get('port'), function() {
debug('Express server listening on port ' + server.address().port);
});
Generally it would make sense to lauch when right-clicking on the project root.
That would work for any project that has package.json
with man
defined.
Related to issues #161 and #162: a new "Run As" procedure that loads Express 4 application from ./bin/www as Express 4 projects are now initialized and loaded from a 'www' script
(
$ node app.js
won't work anymore...)