forked from mirrors/iceshrimp
91b8b7b76b
Co-authored-by: Luna <luna.dragon@suse.com> Reviewed-on: https://iceshrimp.dev/iceshrimp/iceshrimp/pulls/125 Co-authored-by: Luna D Dragon <lunarequest@nullrequest.com> Co-committed-by: Luna D Dragon <lunarequest@nullrequest.com>
19 lines
567 B
TypeScript
19 lines
567 B
TypeScript
import type 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) => {
|
|
// TODO
|
|
//const res = structuredClone(manifest);
|
|
const res = JSON.parse(JSON.stringify(manifest));
|
|
|
|
const instance = await fetchMeta(true);
|
|
|
|
res.short_name = instance.name || "Iceshrimp";
|
|
res.name = instance.name || "Iceshrimp";
|
|
if (instance.themeColor) res.theme_color = instance.themeColor;
|
|
|
|
ctx.set("Cache-Control", "max-age=300");
|
|
ctx.body = res;
|
|
};
|