mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-11-28 23:08:12 +09:00
Add endpoint
This commit is contained in:
parent
ed2ddd2cca
commit
0ed6d30f5e
32
packages/backend/src/server/api/endpoints/custom-motd.ts
Normal file
32
packages/backend/src/server/api/endpoints/custom-motd.ts
Normal file
@ -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;
|
||||
});
|
Loading…
Reference in New Issue
Block a user