Nodeclipse / nodeclipse

Nodeclipse-1 : Eclipse plugin for Node.js, PhantomJS development (Nodeclipse core plugin); Maven and Gradle (with Android) plugins
https://nodeclipse.github.io/
158 stars 78 forks source link

Right-clicking on the project root to launch (use `package.json` `main` defininition). was: A new "Run As" procedure that loads Express 4 application from ./bin/www #163

Open ghost opened 10 years ago

ghost commented 10 years ago

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...)

paulvi commented 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.

ghost commented 10 years ago

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.

paulvi commented 10 years ago

That would require parsing package.json in Java to get that value first.

paulvi commented 10 years ago

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);
});
paulvi commented 9 years ago

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.