nw.js icon indicating copy to clipboard operation
nw.js copied to clipboard

Start server with expressjs

Open billib opened this issue 10 years ago • 3 comments

server.js contain these lines of code

var express = require('express.js');

var app = express();

app.listen(3000);
console.log('Server started');

package.json contain

  "node-main": "server.js",
  "main": "http://localhost:3000",

When I start nw.exe it just instantly close. I run nwjs-v0.12.3-win-ia32 on windows 10.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

billib avatar Dec 23 '15 12:12 billib

try require('express') instead of express.js

NotBobTheBuilder avatar Dec 23 '15 14:12 NotBobTheBuilder

I can't reproduce this issue on Linux/Windows with nwjs-sdk-v0.22.1. The following node works well for me.

server.js:

var express = require('express');

var app = express();
app.get('/', function (req, res) {
  res.send('Hello World!')
})
app.listen(3000);

Christywl avatar May 09 '17 08:05 Christywl

close until there is more information.

Christywl avatar Oct 11 '17 05:10 Christywl