Skip to content
Discussion options

You must be logged in to vote

Create a server route ./src/routes/manifest.webmanifest/+server.ts, & prerender it.

import type { RequestHandler } from './$types';

const manifest = /** generate web app manifest */

export const GET: RequestHandler = async () => {
	return new Response(JSON.stringify(manifest), {
		headers: {
			'content-type': 'application/manifest+json',
		},
	});
};

export const prerender = true; // this line will generate a static manifest.webmanifest

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nstringham
Comment options

Answer selected by nstringham
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants