summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/web/manifest.ts
blob: 61d766006688c98067ab0f8f25cfc327cdc9e41d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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;
};