[core] Add /ping
This commit is contained in:
1 parent
b71567c754
commit
52ef8e8b76
3 files changed
+18
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
import { PingResponse } from '@waha/structures/ping.dto';
|
||||
|
||||
@Controller('ping')
|
||||
@ApiTags('other')
|
||||
export class PingController {
|
||||
@Get()
|
||||
@ApiOperation({ summary: 'Ping the server, perform no operations.' })
|
||||
ping(): PingResponse {
|
||||
return { message: 'pong' };
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@ import { ChattingController } from '../api/chatting.controller';
|
||||
import { ContactsController } from '../api/contacts.controller';
|
||||
import { GroupsController } from '../api/groups.controller';
|
||||
import { HealthController } from '../api/health.controller';
|
||||
import { PingController } from '../api/ping.controller';
|
||||
import { PresenceController } from '../api/presence.controller';
|
||||
import { ScreenshotController } from '../api/screenshot.controller';
|
||||
import {
|
||||
@@ -105,6 +106,7 @@ export const CONTROLLERS = [
|
||||
ScreenshotController,
|
||||
VersionController,
|
||||
HealthController,
|
||||
PingController,
|
||||
];
|
||||
const PROVIDERS = [
|
||||
{
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
export class PingResponse {
|
||||
message: string = 'pong';
|
||||
}
|
||||
Reference in new issue
Block a user