mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-26 20:07:33 -07:00
Add endpoint
This commit is contained in:
parent
ed2ddd2cca
commit
0ed6d30f5e
1 changed files with 32 additions and 0 deletions
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 a new issue