@backstage/backend-defaults
Version:
Backend defaults used by Backstage backend apps
27 lines (23 loc) • 921 B
JavaScript
;
var backendPluginApi = require('@backstage/backend-plugin-api');
var configLoader = require('@backstage/config-loader');
const rootConfigServiceFactoryWithOptions = (options) => backendPluginApi.createServiceFactory({
service: backendPluginApi.coreServices.rootConfig,
deps: {},
async factory() {
const source = configLoader.ConfigSources.default({
argv: options?.argv,
remote: options?.remote,
watch: options?.watch
});
console.log(`Loading config from ${source}`);
return await configLoader.ConfigSources.toConfig(source);
}
});
const rootConfigServiceFactory = Object.assign(
rootConfigServiceFactoryWithOptions,
rootConfigServiceFactoryWithOptions()
);
exports.rootConfigServiceFactory = rootConfigServiceFactory;
exports.rootConfigServiceFactoryWithOptions = rootConfigServiceFactoryWithOptions;
//# sourceMappingURL=rootConfigServiceFactory.cjs.js.map