I have developed a Meteor app. I would like to package this app in the node-webkit app runtime for Chromium. I need the Meteor server process to run locally. How wou
First Bundle your meteor app meteor build --directory /your/node-webkit/project/ and use this code to start your app. But, packaging Meteor with node-webkit can be a little bit more complicated. First, you'll need a mongodb server running on your client computer or somewhere the client can connect anytime.
var path = require('path');
var child_process = require('child_process');
// change these
var PORT = 9000;
var ROOT_URL = 'http://localhost:'+PORT;
var MONGO_URL = 'mongodb://localhost:27017/my_app_db';
var NODE_BIN = '/usr/local/bin/node';
// install npm dependencies
var options = {cwd: path.resolve(__dirname, 'bundle/programs/server/')};
var installNpm = child_process.exec('npm install', options, onNpmInstall);
function onNpmInstall (err, stderr, stdout) {
if(err) throw new Error('could not install npm dependencies');
// start Meteor
var options = {
env: {PORT: PORT, MONGO_URL: MONGO_URL, ROOT_URL: ROOT_URL},
cwd: __dirname
};
var proc = child_process.spawn(NODE_BIN, ['bundle/main.js'], options);
proc.on('close', function (code) {
console.log('Meteor exited with code ' + code);
});
}
You must remove mongo related smart packages if you want a 100% client-side application.