From 8848bb774f42f9fd67768bddefb425c98415580c Mon Sep 17 00:00:00 2001 From: Florian Sommariva <1926041+dtrucs@users.noreply.github.com> Date: Mon, 2 Dec 2024 16:53:41 +0100 Subject: [PATCH] Render manifest.json as json file --- frontend/src/pages/manifest.json.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/manifest.json.tsx b/frontend/src/pages/manifest.json.tsx index 39dccd4d7..98ff4a984 100644 --- a/frontend/src/pages/manifest.json.tsx +++ b/frontend/src/pages/manifest.json.tsx @@ -1,11 +1,11 @@ import { NextPageContext } from 'next'; -import { default as getNextConfig } from 'next/config'; +import getNextConfig from 'next/config'; const ManifestJson = (): null => { return null; }; -ManifestJson.getInitialProps = (props: NextPageContext) => { +export const getServerSideProps = (props: NextPageContext) => { const { publicRuntimeConfig: { global, manifest = {} }, } = getNextConfig(); @@ -43,9 +43,12 @@ ManifestJson.getInitialProps = (props: NextPageContext) => { ...defaultManifest, ...manifest, }; - res.setHeader('Content-Type', 'text/plain'); + res.setHeader('Content-Type', 'application/json'); res.write(JSON.stringify(content, null, 2)); res.end(); + return { + props: {}, + }; }; export default ManifestJson;