How to use the forever.startServer function in forever

To help you get started, we’ve selected a few forever examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github appnexus / sicksync / bin / remote.js View on Github external
// TODO: change these files paths, right now they output to user's home location on remote server
// due to the fact that the process.cwd() is /home/cdopuch
var daemon = forever.startDaemon(
    daemonFilePath,
    {
        // NOTE: these log files are truncated on each new run
        // TODO: rotate the logs so we can save old logs
        'logFile': 'new-remote-daemon.log',
        'outFile': 'new-remote-daemon-stdout.log',
        'errFile': 'new-remote-daemon-stderr.log',
        'max': 1,
        'uid': 'remote-daemon'
    }
);
var server = forever.startServer(daemon);

// process.stdout.write('[remote.js] up and waiting');
console.log('[remote.js] up and waiting');
github zenirc / zenircbot / services / admin.js View on Github external
function start_service(service) {
    if (services[service]) {
        if (services[service].running) {
            zen.send_admin_message(service + ' is already running');
        } else {
            zen.send_admin_message('starting ' + service);
            services[service].start();
        }
    } else {
        zen.send_admin_message('starting ' + service);
        child = forever.start([language_map[service.split('.')[1]], service], {
            max: 10000,
            silent: false
        });
        forever.startServer(child);
        services[service] = child;
        forever.cli.list();
    }
}
github ltackett / musictocodeto / forever.js View on Github external
var forever = require('forever');
var child = forever.start([ 'socketstream', 'start' ], {
  max : 1,
  silent : true
});

forever.startServer(child);
github SocketCluster / loadbalancer / bin / cli.js View on Github external
var startBalancer = function () {
  var child = forever.startDaemon(balancerFilePath, {
    uid: balancerUid,
    max: MAX_RESTARTS,
    logFile: logFileName,
    outFile: logFileName,
    errFile: logFileName,
    args: commandRawArgs
  });
  forever.startServer(child);
  successMessage('Started loadbalancer - Logging to ' + logFileName);
};

forever

A simple CLI tool for ensuring that a given node script runs continuously (i.e. forever)

MIT
Latest version published 3 years ago

Package Health Score

56 / 100
Full package analysis