mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-16 18:29:01 +01:00
16 lines
496 B
TypeScript
16 lines
496 B
TypeScript
import Koa from 'koa';
|
|
import { fetchMeta } from '@/misc/fetch-meta.js';
|
|
import manifest from './manifest.json' assert { type: 'json' };
|
|
|
|
export const manifestHandler = async (ctx: Koa.Context) => {
|
|
const res = structuredClone(manifest);
|
|
|
|
const instance = await fetchMeta(true);
|
|
|
|
res.short_name = instance.name || 'Misskey';
|
|
res.name = instance.name || 'Misskey';
|
|
if (instance.themeColor) res.theme_color = instance.themeColor;
|
|
|
|
ctx.set('Cache-Control', 'max-age=300');
|
|
ctx.body = res;
|
|
};
|