From f7ebf14501e9b86acef551507e5b3ff56527ac7d Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 9 Jan 2021 09:25:27 +0900 Subject: [PATCH] Add ping api --- src/server/api/endpoints/ping.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/server/api/endpoints/ping.ts diff --git a/src/server/api/endpoints/ping.ts b/src/server/api/endpoints/ping.ts new file mode 100644 index 000000000..0b1bb6e16 --- /dev/null +++ b/src/server/api/endpoints/ping.ts @@ -0,0 +1,27 @@ +import define from '../define'; + +export const meta = { + requireCredential: false as const, + + tags: ['meta'], + + params: { + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + pong: { + type: 'number' as const, + optional: false as const, nullable: false as const, + }, + } + } +}; + +export default define(meta, async () => { + return { + pong: Date.now(), + }; +});