mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 01:35:18 -04:00
fix(repository): Move backend code into subdirectory
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
86584e705f
commit
bf30cbcf48
272 changed files with 87 additions and 67 deletions
48
backend/src/api/public/monitoring/monitoring.controller.ts
Normal file
48
backend/src/api/public/monitoring/monitoring.controller.ts
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { Controller, Get, UseGuards } from '@nestjs/common';
|
||||
import { ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
|
||||
import { TokenAuthGuard } from '../../../auth/token.strategy';
|
||||
import { MonitoringService } from '../../../monitoring/monitoring.service';
|
||||
import { ServerStatusDto } from '../../../monitoring/server-status.dto';
|
||||
import { OpenApi } from '../../utils/openapi.decorator';
|
||||
|
||||
@UseGuards(TokenAuthGuard)
|
||||
@OpenApi(401)
|
||||
@ApiTags('monitoring')
|
||||
@ApiSecurity('token')
|
||||
@Controller('monitoring')
|
||||
export class MonitoringController {
|
||||
constructor(private monitoringService: MonitoringService) {}
|
||||
|
||||
@Get()
|
||||
@OpenApi(
|
||||
{
|
||||
code: 200,
|
||||
description: 'The server info',
|
||||
dto: ServerStatusDto,
|
||||
},
|
||||
403,
|
||||
)
|
||||
getStatus(): Promise<ServerStatusDto> {
|
||||
// TODO: toServerStatusDto.
|
||||
return this.monitoringService.getServerStatus();
|
||||
}
|
||||
|
||||
@Get('prometheus')
|
||||
@OpenApi(
|
||||
{
|
||||
code: 200,
|
||||
description: 'Prometheus compatible monitoring data',
|
||||
mimeType: 'text/plain',
|
||||
},
|
||||
403,
|
||||
)
|
||||
getPrometheusStatus(): string {
|
||||
return '';
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue