FoundKey/packages/backend/src/server/web/manifest.ts
Norm 57f4312a27
chore: Change Misskey references to Foundkey
Also remove the contributors list from about-foundkey (renamed from
about-misskey).

Some comments that referenced Misskey were also translated to English.

Closes: FoundKeyGang/FoundKey#141
2022-09-13 13:19:36 -04:00

19 lines
575 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): Promise<void> => {
// TODO
//const res = structuredClone(manifest);
const res = JSON.parse(JSON.stringify(manifest));
const instance = await fetchMeta(true);
res.short_name = instance.name || 'FoundKey';
res.name = instance.name || 'FoundKey';
if (instance.themeColor) res.theme_color = instance.themeColor;
ctx.set('Cache-Control', 'max-age=300');
ctx.body = res;
};