mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 15:14:56 -04:00

For a better structure of the autogenerated apidoc website tags are used. Each Controller get it's own tag and will be put in a separate section. See https://docs.nestjs.com/openapi/operations#tags Signed-off-by: Philip Molares <philip.molares@udo.edu>
31 lines
898 B
TypeScript
31 lines
898 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import { Controller, Get, UseGuards } from '@nestjs/common';
|
|
import { MonitoringService } from '../../../monitoring/monitoring.service';
|
|
import { TokenAuthGuard } from '../../../auth/token-auth.guard';
|
|
import { ApiSecurity, ApiTags } from '@nestjs/swagger';
|
|
import { ServerStatusDto } from '../../../monitoring/server-status.dto';
|
|
|
|
@ApiTags('monitoring')
|
|
@ApiSecurity('token')
|
|
@Controller('monitoring')
|
|
export class MonitoringController {
|
|
constructor(private monitoringService: MonitoringService) {}
|
|
|
|
@UseGuards(TokenAuthGuard)
|
|
@Get()
|
|
getStatus(): Promise<ServerStatusDto> {
|
|
// TODO: toServerStatusDto.
|
|
return this.monitoringService.getServerStatus();
|
|
}
|
|
|
|
@UseGuards(TokenAuthGuard)
|
|
@Get('prometheus')
|
|
getPrometheusStatus() {
|
|
return '';
|
|
}
|
|
}
|