From 92f16f2a9000c7c4f960b0d08f249a79e8116eea 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(), + }; +});