3.0.2 • Published 6 years ago

yocto-core-stack v3.0.2

Weekly downloads
41
License
Apache-2.0
Repository
github
Last release
6 years ago

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

3.0.2

6 years ago

3.0.1

7 years ago

3.0.0

7 years ago

2.1.0

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.3.6

8 years ago

1.3.5

8 years ago

1.3.4

8 years ago

1.3.3

8 years ago

1.3.2

9 years ago

1.3.1

9 years ago

1.3.0

9 years ago

1.2.9

9 years ago

1.2.8

9 years ago

1.2.7

9 years ago

1.2.6

9 years ago

1.2.5

9 years ago

1.2.4

9 years ago

1.2.3

9 years ago

1.2.2

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.8

9 years ago

1.1.7

9 years ago

1.1.6

9 years ago

1.1.5

9 years ago

1.1.4

9 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.5

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago