Just simply require
the server.js
file in your main file (e.g. app.js
):
var app = require("app")
, server = require("./server")
;
...
And in the server.js
file you can have:
require("http").createServer(function (req, res) {
res.end("Hello from server started by Electron app!");
}).listen(9000)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…