quture-bootstrap

1.1.0 • Public • Published

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);
}

Readme

Keywords

none

Package Sidebar

Install

npm i quture-bootstrap

Weekly Downloads

0

Version

1.1.0

License

MIT

Last publish

Collaborators

  • kieronwiltshire