yocto-core-stack

3.0.2 • Public • Published

NPM

alt text Code Climate Test Coverage Issue Count Build Status

Overview

This module is a part of yocto node modules for NodeJS.

Please see our NPM repository for complete list of available tools (completed day after day).

This module manage init / start our node core stack based on :

This module is core module of our tools : YoctopusJs

Read this before any usage

How to use

First you need to setup a core.json config file at process.cwd() path.

This file must have this structure :

{
  "config" : "YOUR_CONFIG_PATH_HERE",
  "env" : {
    "development" : {
      "logger" : {
        "rotate" : {
          "path" : "YOUR_LOG_PATH_HERE",
          "name" : "YOUR_LOG_FILE_NAME_HERE"
        }
      }
    },
    "staging" : {
      "logger" : {
        "rotate" : {
          "path" : "YOUR_LOG_PATH_HERE",
          "name" : "YOUR_LOG_FILE_NAME_HERE"
        }
      }
    }, 
    "production" : {
      "logger" : {
        "rotate" : {
          "path" : "YOUR_LOG_PATH_HERE",
          "name" : "YOUR_LOG_FILE_NAME_HERE"
        }
      }
    }
  }
}

And start your app like example below :

var logger    = require('yocto-core-stack');
var core      = require('yocto-core-stack');
 
// set debug to true if needed
core.debug = true;
 
// Init your app first
core.init().then(function () {
  // Init succeed start your app
  core.start().then(function () {
 
  /********************************************
   *              YOUR CODE HERE              *
   *******************************************/
 
  }).catch(function (error) {
    // error process
  })
}).catch(function (error) {
  // error process
});

How to add external middleware on current app

It's simple juste use an utility method for that :

// your middleware
var YOUR_MIDDLEWARE = function(){} ...
// add it
core.useOnApp(YOUR_MIDDLEWARE);

Yocto Stack Generator

You can also use our yeoman generator to generate an app automatically.

For this see yoctopus-generator FAQ

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
3.0.22latest

Version History

VersionDownloads (Last 7 Days)Published
3.0.22
3.0.10
3.0.00
2.1.00
2.0.10
2.0.00
1.3.60
1.3.50
1.3.40
1.3.30
1.3.20
1.3.10
1.3.00
1.2.90
1.2.80
1.2.70
1.2.60
1.2.50
1.2.40
1.2.30
1.2.20
1.2.10
1.2.00
1.1.80
1.1.70
1.1.60
1.1.51
1.1.40
1.1.30
1.1.20
1.1.10
1.1.00
1.0.50
1.0.30
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i yocto-core-stack

Weekly Downloads

3

Version

3.0.2

License

Apache-2.0

Unpacked Size

25.8 kB

Total Files

7

Last publish

Collaborators

  • yocto