Members


ui_root

Description

Gets the location of documentation folder

Details

config

Description

If a valid config file is found, load the data using yaml loader

Details

inputsKeys

Description

Defined only for logging purposes, does not hold any significance from application logic perspective.

Details

inputs

Description

Create a configuration array in the order of parameters as defined by start() function in main app. The reason we are storing the parameters in an is to have a error check in case of undefined values, before we actually pass the values to start() function. If all values are passed correctly, start() function can be called by simply spreading the array ...inputs

Details

start

Description

Exports the start function which should be called from bin/camouflage.js with required parameters

Details

app

Description

Exports app for testing purpose

Details

Methods


setLogLevel( loglevel )

Parameters
Name Type Description
loglevel string

set log level as provided by config

Details

registerCustomHandlebars( extHelpers )

Description
  • If file exists read file and parse it to a JSONObject of type CustomHandleBar
  • For each custom handlebar, check if the name equals any of the inbuilt handlebars
  • If not, register helpers by their name and executing the IIFE code provided under logic
  • Create request and logger objects under the scope of each custom handlebar
Parameters
Name Type Description
extHelpers string

location of the external handlebars json file


registerHandlebars( extHelpers )

Description

Creates a instance of HandleBarHelper and register each custom helper

  • If external helper is null, do not call registerCustomHandlebars()
Parameters
Name Type Description
extHelpers string

location of the external handlebars json file


start( inputMocksDir, inputPort, enableHttps, enableHttp2, enableGrpc, key, cert, inputHttpsPort, inputHttp2Port, inputGrpcHost, inputGrpcPort, inputGrpcMocksDir, inputGrpcProtosDir, loglevel, backupEnable, backupCron, configFilePath, extHelpers )

Description

Initializes required variables and starts a 1 master X workers configuration

Parameters
Name Type Description
inputMocksDir string

Mocks directory from config file, overrides default mocksDir

inputPort number

Input http port, overrides default 8080 port

enableHttps boolean

true if https is to be enabled

enableHttp2 boolean

true if http2 is to be enabled

enableGrpc boolean

true if grpc is to be enabled

key string

location of server.key file if https is enabled

cert string

location of server.cert file if https is enabled

inputHttpsPort number

Input https port, overrides httpsPort

inputHttp2Port number

Input http2 port, overrides httpsPort

inputGrpcHost string

Input gRPC host, overrides grpcHost

inputGrpcPort number

Input gRPC port, overrides grpcPort

inputGrpcMocksDir string

Input gRPC mocks directory location, overrides grpcMocksDir

inputGrpcProtosDir string

Input gRPC protos directory location, overrides grpcProtos

loglevel string

Desired loglevel

backupEnable string

true if backup is enabled

backupCron string

cron schedule for backup

configFilePath string

location of config file

extHelpers string

location of the external handlebars json file

Details

walk( dir )

Description

Recursively prepares a list of files in a given directory

Parameters
Name Type Description
dir

mocksDir

Returns

array of files in a given directory