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 loglevelstring 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 extHelpersstring location of the external handlebars json file
Details
-
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 extHelpersstring location of the external handlebars json file
Details
-
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 inputMocksDirstring Mocks directory from config file, overrides default mocksDir
inputPortnumber Input http port, overrides default 8080 port
enableHttpsboolean true if https is to be enabled
enableHttp2boolean true if http2 is to be enabled
enableGrpcboolean true if grpc is to be enabled
keystring location of server.key file if https is enabled
certstring location of server.cert file if https is enabled
inputHttpsPortnumber Input https port, overrides httpsPort
inputHttp2Portnumber Input http2 port, overrides httpsPort
inputGrpcHoststring Input gRPC host, overrides grpcHost
inputGrpcPortnumber Input gRPC port, overrides grpcPort
inputGrpcMocksDirstring Input gRPC mocks directory location, overrides grpcMocksDir
inputGrpcProtosDirstring Input gRPC protos directory location, overrides grpcProtos
loglevelstring Desired loglevel
backupEnablestring true if backup is enabled
backupCronstring cron schedule for backup
configFilePathstring location of config file
extHelpersstring 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 dirmocksDir
Returns
Details