Add manifest generator
This commit is contained in:
30
src/routes/manifest.webmanifest/+server.ts
Normal file
30
src/routes/manifest.webmanifest/+server.ts
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import { json } from "@sveltejs/kit";
|
||||||
|
import type { RequestHandler } from './$types';
|
||||||
|
import favicon from '$lib/assets/favicon.svg?url';
|
||||||
|
|
||||||
|
export const prerender = true;
|
||||||
|
|
||||||
|
export const GET: RequestHandler = ({ url }) => {
|
||||||
|
const manifest = {
|
||||||
|
name: "OwlBoard Maps",
|
||||||
|
short_name: "OwlBoard Maps",
|
||||||
|
start_url: "/",
|
||||||
|
display: "standalone",
|
||||||
|
theme_color: "#ff6600",
|
||||||
|
background_color: "#ffffff",
|
||||||
|
icons: [
|
||||||
|
{
|
||||||
|
src: favicon,
|
||||||
|
sizes: "any",
|
||||||
|
type: "image/svg+xml"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
return json(manifest, {
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/manifest+json',
|
||||||
|
'Cache-Control': 'public, max-age=3600',
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user