# Global

##

### Methods

#### _admin_prefix(adminPath) → {String}

returns a route string without the precending '/'

##### Parameters:

Name | Type | Description
--- | --- | ---
`adminPath` | String |

Source:
  - lib/utilities/routing.js, line 23

##### Returns:

Type
  String

#### _manifest_prefix(adminPath) → {String}

returns a route string that always has a preceding '/' and a suffixed '/', this is typically used for specifiying links to paths as absolute urls

##### Parameters:

Name | Type | Description
--- | --- | ---
`adminPath` | String |

Source:
  - lib/utilities/routing.js, line 33

##### Returns:

Type
  String

#### _route_prefix(adminPath) → {String}

returns a string that's used in an express router that's always prefixed with a preceding '/'

##### Parameters:

Name | Type | Description
--- | --- | ---
`adminPath` | String |

Source:
  - lib/utilities/routing.js, line 9

##### Returns:

route used for express router, that's always prefixed with a "/"

Type
  String

#### all_prefixes(adminPath) → {String}

short hand function to return all prefix types

##### Parameters:

Name | Type | Description
--- | --- | ---
`adminPath` | String |

Source:
  - lib/utilities/routing.js, line 46

##### Returns:

Type
  String

#### configRuntimeEnvironment() → {Promise}

sets the runtime environment correctly, there are multiple ways to set the runtime environment (via command line arguments, or via environment variables)
It will prioritize loading via command line argument first, and then environment variables, and finally it will use the last runtime environment

Source:
  - lib/init/runtime.js, line 77

##### Returns:

configRuntimeEnvironment sets up application config db

Type
  Promise

#### configureLogger() → {Promise}

configures winston

Source:
  - lib/init/logger.js, line 57

##### Returns:

configureLogger sets up winston

Type
  Promise

#### configureLowkie() → {Promise}

configureLowkie creates a loki connection to store DB based configurations

Source:
  - lib/init/config.js, line 24

##### Returns:

connects to configuration db

Type
  Promise

#### configureMongoose() → {Promise}

configureMongoose creates a mongo connection to store DB based configurations

Source:
  - lib/init/config.js, line 64

##### Returns:

connects to configuration db

Type
  Promise

#### configureSequelize() → {Promise}

configureSequelize creates a mongo connection to store DB based configurations

Source:
  - lib/init/config.js, line 122

##### Returns:

connects to configuration db

Type
  Promise

#### configureViews() → {Promise}

configure express view rendering options

Source:
  - lib/init/express.js, line 33

##### Returns:

Type
  Promise

#### endTimer()

Ends initialization console timer

Source:
  - lib/init/consoleTimer.js, line 28

##### Returns:

Promise

#### formatResponse() → {object}

Enforces the shape of an api response, by allow for three properties (result,status and data) all other properties are on data

##### Parameters:

Name | Type | Description
--- | --- | ---
`options.result` | string | result of request (usually sucess or error)
`options.status` | number | http resonse code equivalent
`options.data` | object | data for response

Source:
  - lib/utilities/routing.js, line 79

##### Returns:

with the shape {result,status,data}

Type
  object

#### getEnv(argv) → {string|boolean}

get the application environment from command line arguments

##### Parameters:

Name | Type | Description
--- | --- | ---
`argv` | any | parsed command line arguments

Source:
  - lib/init/runtime.js, line 12

##### Returns:

returns the value of the enviroment or false

Type
  string | boolean

#### handler() → {object}

this is the proxy handler for periodic, provides access to native expess methods as well.

Source:
  - lib/periodicProxyHandler.js, line 3

##### Returns:

Type
  object

#### initializeExpress() → {Promise}

sets the runtime environment correctly

Source:
  - lib/init/express.js, line 587

##### Returns:

configRuntimeEnvironment sets up application config db

Type
  Promise

#### loadConfiguration()

reads content/config/(config.json||config.js) for the configuration database

Source:
  - lib/init/config.js, line 170

##### Returns:

Promise loadConfiguration sets up application config db

#### setAppRunningEnv(env, operation, processRuntimeConfig) → {boolean|Promise}

sets the application runtime environment and save last run environment into configuration

##### Parameters:

Name | Type | Description
--- | --- | ---
`env` | any | this is the enviroment variable to set
`operation` | string | either update the config db, or create a new entry for process.runtime
`processRuntimeConfig` | object | existing runtime config from configuration database

Source:
  - lib/init/runtime.js, line 36

##### Returns:

returns a resolved promise after configuration database operation

Type
  boolean | Promise

#### setUpFolderStructure()

this will setup a periodic application folder structure if one doesnt exist, it will not overwrite existing configs

Source:
  - lib/init/folderStructure.js, line 12

##### Returns:

Promise setUpFolderStructure will copy folders from the application __STRUCTURE directory to initialize the application

#### startTimer()

Starts intialization console timer

Source:
  - lib/init/consoleTimer.js, line 12

##### Returns:

Promise