Files
aigen/server/routes/manifest.webmanifest.ts
T

25 lines
733 B
TypeScript

import { isXaigenStudio } from '~/utils/videoModels'
export default defineEventHandler((event) => {
const pub = useRuntimeConfig().public as { instanceName?: string; studio?: string }
const xaigen = isXaigenStudio(pub)
const name = String(pub.instanceName || (xaigen ? 'xAIGen' : 'AIGen'))
setHeader(event, 'Content-Type', 'application/manifest+json')
setHeader(event, 'Cache-Control', 'no-cache')
return {
name,
short_name: name,
start_url: '/',
scope: '/',
display: 'standalone',
background_color: '#09090b',
theme_color: '#09090b',
icons: [{
src: xaigen ? '/favicon.svg' : '/favicon-aigen.svg',
sizes: 'any',
type: 'image/svg+xml',
purpose: 'any'
}]
}
})