This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
var nexe = require('nexe');
|
||||
|
||||
nexe.compile(
|
||||
{
|
||||
input: "./index.js",
|
||||
output: "./out.exe",
|
||||
nodeVersion: "latest",
|
||||
nodeTempDir: "",
|
||||
python: "C:\\Python27\\python.exe",
|
||||
flags: true
|
||||
},
|
||||
function (err) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1 @@
|
||||
{ "head": "Success!" }
|
||||
@@ -0,0 +1,7 @@
|
||||
if(false) {
|
||||
require('./not-found-file.json');
|
||||
}
|
||||
|
||||
var out = require('./found-file.json');
|
||||
|
||||
console.log(out.head);
|
||||
@@ -0,0 +1,2 @@
|
||||
all:
|
||||
nexe -i ./ -o ./hello-world.nex
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"main": "./index.js",
|
||||
"dependencies": {
|
||||
"nexe": "*"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
console.log("hello browser!");
|
||||
@@ -0,0 +1,17 @@
|
||||
var nexe = require('nexe');
|
||||
|
||||
nexe.compile(
|
||||
{
|
||||
input: "./index.js",
|
||||
output: "./hellowWorld.exe",
|
||||
nodeVersion: "0.10.33",
|
||||
nodeTempDir: "",
|
||||
flags: true,
|
||||
resourceFiles: ["./message.txt"]
|
||||
},
|
||||
function (err) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,23 @@
|
||||
var http = require("http"),
|
||||
fs = require("fs"),
|
||||
path = require("path"),
|
||||
nexeres = require("nexeres"),
|
||||
childProc = require("child_process"),
|
||||
port = 1337;
|
||||
|
||||
//Fork a new process to execute the broser.js
|
||||
childProc.fork(path.join(__dirname, "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 not given)
|
||||
console.log("started HTTP server on port %d", port = Number(process.argv.concat().pop()) || port);
|
||||
|
||||
http.createServer(function(req, res) {
|
||||
//return the embeded file in response to any request
|
||||
|
||||
res.write(nexeres.get("message.txt"));
|
||||
|
||||
res.end();
|
||||
}).listen(port);
|
||||
@@ -0,0 +1,2 @@
|
||||
all:
|
||||
nexe -i ./ -o ./hello-world.nex -r 0.8.18
|
||||
@@ -0,0 +1 @@
|
||||
hello world!
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"main": "./index.js",
|
||||
"browser": "./index.js"
|
||||
}
|
||||
@@ -6,9 +6,7 @@ nexe.compile(
|
||||
output: "",
|
||||
nodeVersion: "0.10.33",
|
||||
nodeTempDir: "",
|
||||
python: "C:\\Python27\\python.exe",
|
||||
flags: true,
|
||||
resourceFiles: ["./message.txt"]
|
||||
flags: true
|
||||
},
|
||||
function (err) {
|
||||
if (err) {
|
||||
|
||||
@@ -16,8 +16,8 @@ console.log("started HTTP server on port %d", port = Number(process.argv.concat(
|
||||
|
||||
http.createServer(function(req, res) {
|
||||
//return the embeded file in response to any request
|
||||
|
||||
res.write(nexeres.get("message.txt"));
|
||||
|
||||
res.write("Hello, world!");
|
||||
|
||||
res.end();
|
||||
}).listen(port);
|
||||
|
||||
Reference in New Issue
Block a user