PrivateApi: Add config controller

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2021-03-01 21:16:34 +01:00 committed by David Mehren
parent 9747ea209c
commit 86f5498f51
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
3 changed files with 80 additions and 2 deletions

View file

@ -0,0 +1,25 @@
/*
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { Controller, Get } from '@nestjs/common';
import { ConsoleLoggerService } from '../../../logger/console-logger.service';
import { FrontendConfigService } from '../../../frontend-config/frontend-config.service';
import { FrontendConfigDto } from '../../../frontend-config/frontend-config.dto';
@Controller('config')
export class ConfigController {
constructor(
private readonly logger: ConsoleLoggerService,
private frontendConfigService: FrontendConfigService,
) {
this.logger.setContext(ConfigController.name);
}
@Get()
async getFrontendConfig(): Promise<FrontendConfigDto> {
return await this.frontendConfigService.getFrontendConfig();
}
}