Make the example code demonstrate forked process and dynamic require
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
var nexe = require('nexe');
|
||||
|
||||
nexe.compile(
|
||||
{
|
||||
input: "./index.js",
|
||||
output: "./hellowWord.exe",
|
||||
nodeVersion: "0.10.33",
|
||||
nodeTempDir: "",
|
||||
flags: true
|
||||
},
|
||||
function (err) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -3,6 +3,14 @@ fs = require("fs"),
|
||||
path = require("path"),
|
||||
port = 1337;
|
||||
|
||||
//Fork a new process to execute the broser.js
|
||||
var childProc = require("child_process");
|
||||
childProc.fork("./browser.js");
|
||||
if (false) {
|
||||
require("./browser.js"); //force the bundler to include the .js file
|
||||
}
|
||||
|
||||
//start a web server on specified port (or default if non given)
|
||||
console.log("started HTTP server on port %d", port = Number(process.argv.concat().pop()) || port);
|
||||
|
||||
http.createServer(function(req, res) {
|
||||
|
||||
Reference in New Issue
Block a user