diff --git a/packages/backend/src/server/api/endpoints/custom-motd.ts b/packages/backend/src/server/api/endpoints/custom-motd.ts new file mode 100644 index 000000000..859bde904 --- /dev/null +++ b/packages/backend/src/server/api/endpoints/custom-motd.ts @@ -0,0 +1,32 @@ +// import { IsNull } from 'typeorm'; +import { fetchMeta } from '@/misc/fetch-meta.js'; +import define from '../define.js'; + +export const meta = { + tags: ['meta'], + + requireCredential: false, + requireCredentialPrivateMode: true, + + res: { + type: 'array', + optional: false, nullable: false, + items: { + type: 'string', + optional: false, nullable: false, + }, + }, +} as const; + +export const paramDef = { + type: 'array', + properties: {}, + required: [], +} as const; + +// eslint-disable-next-line import/no-default-export +export default define(meta, paramDef, async () => { + const meta = await fetchMeta(); + const motd = await Promise.all(meta.customMOTD.map(x => x)); + return motd; +});