mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-12-02 14:47:54 -07:00
18 lines
563 B
TypeScript
18 lines
563 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 || "Calckey";
|
|
res.name = instance.name || "Calckey";
|
|
if (instance.themeColor) res.theme_color = instance.themeColor;
|
|
|
|
ctx.set("Cache-Control", "max-age=300");
|
|
ctx.body = res;
|
|
};
|