diff --git a/lib/utils/backup-service.js b/lib/utils/backup-service.js new file mode 100644 --- /dev/null +++ b/lib/utils/backup-service.js @@ -0,0 +1,15 @@ +// @flow + +import { replacePathParams, type URLPathParams } from './url-utils.js'; +import backupServiceConfig from '../facts/backup-service.js'; +import type { BackupServiceHTTPEndpoint } from '../facts/backup-service.js'; + +function makeBackupServiceEndpointURL( + endpoint: BackupServiceHTTPEndpoint, + params: URLPathParams = {}, +): string { + const path = replacePathParams(endpoint.path, params); + return `${backupServiceConfig.url}${path}`; +} + +export { makeBackupServiceEndpointURL };