Skip to content

Commit

Permalink
Render manifest.json as json file
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrucs committed Dec 2, 2024
1 parent 82cf623 commit 8848bb7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions frontend/src/pages/manifest.json.tsx
Original file line number Diff line number Diff line change
@@ -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();
Expand Down Expand Up @@ -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;

0 comments on commit 8848bb7

Please sign in to comment.