[backend] Fix build on Node 22

This commit is contained in:
Laura Hausmann 2024-07-03 23:51:17 +02:00
parent 01555c995e
commit 09afdeb04c
No known key found for this signature in database
GPG Key ID: D044E84C5BE01605

View File

@ -1,12 +1,12 @@
import type Koa from "koa"; import type Koa from "koa";
import { fetchMeta } from "@/misc/fetch-meta.js"; import { fetchMeta } from "@/misc/fetch-meta.js";
import manifest from "./manifest.json" assert { type: "json" }; import fs from "fs";
import path from 'path';
const manifest = JSON.parse(fs.readFileSync(path.resolve('./src/server/web/manifest.json'), 'utf-8'));
export const manifestHandler = async (ctx: Koa.Context) => { export const manifestHandler = async (ctx: Koa.Context) => {
// TODO const res = manifest;
//const res = structuredClone(manifest);
const res = JSON.parse(JSON.stringify(manifest));
const instance = await fetchMeta(true); const instance = await fetchMeta(true);
res.short_name = instance.name || "Iceshrimp"; res.short_name = instance.name || "Iceshrimp";