// @refresh reload import { createHandler, StartServer } from "@solidjs/start/server"; import { installIntoGlobal } from "iterator-helpers-polyfill"; installIntoGlobal(); export default createHandler(({ nonce }) => { return ( { return ( {assets} {children} {scripts} ); }} /> ); }, event => { const nonce = crypto.randomUUID(); const base = `'self' 'nonce-${nonce}' 'unsafe-eval'`; const policies = { default: base, connect: `${base} ws://localhost:*`, style: `'self' data: 'unsafe-inline'`, // style: `${base} data: `, } as const; event.response.headers.append('Content-Security-Policy', Object.entries(policies).map(([p, v]) => `${p}-src ${v}`).join('; ')) return { nonce }; });