1.1.0 • Published 7 years ago

quture-bootstrap v1.1.0

Weekly downloads
6
License
MIT
Repository
github
Last release
7 years ago

quture-bootstrap

A package to bootstrap a quture-app.


Introduction

The package exports a function that bootstraps Quture applications into a HTTP / HTTPS server. Documentation can be found here.

Basic usage

'use strict';

const qutureApp = require('./my/quture/app');
const bootstrap = require('quture-bootstrap');

// Instantiate a server instance
let server = bootstrap.start(qutureApp);


// If the app.secure configuration option is set to true
// then you must provide the paths to the files containing
// the public key certificate
let server = bootstrap.start(qutureApp, {
  key: path.join(__dirname, 'key.pem'),
  certificate: path.join(__dirname, 'certificate.pem')
});

This package can also be used with the cluster module as shown below:

'use strict';

const os = require('os');
const cluster = require('cluster');
const qutureApp = require('./my/quture/app');
const bootstrap = require('quture-bootstrap');

if (process.env.NODE_ENV !== 'testing' && process.env.NODE_ENV !== 'development' && cluster.isMaster) {
  for (let i = 0; i < os.cpus().length; i++) {
    cluster.fork();
  }

  cluster.on('exit', function (worker) {
    debug('Worker %d died.', worker.id);
    cluster.fork();
  });
} else {
  let server = bootstrap.start(qutureApp);
}
1.1.0

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago