nw.js
nw.js copied to clipboard
Start server with expressjs
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.
try require('express') instead of express.js
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);
close until there is more information.