From 174f8022eb5828db3e9af01afcf72fe7526c4c57 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 2 Nov 2018 13:47:44 +0900 Subject: Refactor --- src/server/api/endpoints/stats.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/server/api/endpoints/stats.ts') diff --git a/src/server/api/endpoints/stats.ts b/src/server/api/endpoints/stats.ts index fc195da22d..56549848dc 100644 --- a/src/server/api/endpoints/stats.ts +++ b/src/server/api/endpoints/stats.ts @@ -1,10 +1,19 @@ import Meta from '../../../models/meta'; +import define from '../define'; -/** - * Get the misskey's statistics - */ -export default () => new Promise(async (res, rej) => { +export const meta = { + requireCredential: false, + + desc: { + 'en-US': 'Get the instance\'s statistics' + }, + + params: { + } +}; + +export default define(meta, () => new Promise(async (res, rej) => { const meta = await Meta.findOne(); res(meta ? meta.stats : {}); -}); +})); -- cgit v1.2.3-freya