MCPcopy Index your code
hub / github.com/scality/cloudserver / findConfigFile

Function findConfigFile

lib/Config.js:43–56  ·  view source on GitHub ↗
(fileName)

Source from the content-addressed store, hash-verified

41];
42
43function findConfigFile(fileName) {
44 if (fileName[0] === '/') {
45 return fileName;
46 }
47 const containingPath = configSearchPaths.find(configPath => {
48 const testFilePath = path.join(configPath, fileName);
49 return fs.existsSync(testFilePath);
50 });
51 if (!containingPath) {
52 throw new Error(`Unable to find the configuration file "${fileName}" ` +
53 `under the paths: ${JSON.stringify(configSearchPaths)}`);
54 }
55 return path.join(containingPath, fileName);
56}
57
58// whitelist IP, CIDR for health checks
59const defaultHealthChecks = { allowFrom: ['127.0.0.1/8', '::1'] };

Callers 2

constructorMethod · 0.85
_getAuthDataMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected