mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-09 13:51:57 -04:00

Co-authored-by: Philip Molares <philip.molares@udo.edu> Signed-off-by: Philip Molares <philip.molares@udo.edu> Signed-off-by: Erik Michelson <github@erik.michelson.eu>
30 lines
935 B
TypeScript
30 lines
935 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2025 The HedgeDoc developers (see AUTHORS file)
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
import { ConfigFactoryKeyHost, registerAs } from '@nestjs/config';
|
|
import { ConfigFactory } from '@nestjs/config/dist/interfaces';
|
|
|
|
import { ExternalServicesConfig } from '../external-services.config';
|
|
|
|
export function createDefaultMockExternalServicesConfig(): ExternalServicesConfig {
|
|
return {
|
|
plantumlServer: 'https://plantuml.example.com',
|
|
imageProxy: 'https://imageProxy.example.com',
|
|
};
|
|
}
|
|
|
|
export function registerExternalServiceConfig(
|
|
externalServicesConfig: ExternalServicesConfig,
|
|
): ConfigFactory<ExternalServicesConfig> &
|
|
ConfigFactoryKeyHost<ExternalServicesConfig> {
|
|
return registerAs(
|
|
'externalServicesConfig',
|
|
(): ExternalServicesConfig => externalServicesConfig,
|
|
);
|
|
}
|
|
|
|
export default registerExternalServiceConfig(
|
|
createDefaultMockExternalServicesConfig(),
|
|
);
|