rudeshark.net/packages/backend/src/server/web/manifest.ts

17 lines
496 B
TypeScript
Raw Normal View History

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);
2019-04-24 01:11:19 +02:00
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;
};