license import { h } from '@builder.io/qwik' ; import { renderToString , RenderToStringOptions , QwikLoader } from '@builder.io/qwik/server' ; import { Footer , Header } from './my-app' ; returns export function renderApp ( opts ) { return renderToString ( < html > < head > < title > Qwik Blank App < /title> < /head> < body q : base = "/build/" > < Header /> < div id = "my-content" > < /div> < Footer / > < script > ( { fetchQwikBuilderContent . toString ( ) } ) ( ) ; < /script> < QwikLoader debug = { opts . debug } / > < /body> < /html>, opts); } const fetchQwikBuilderContent = async ( ) => { const qwikUrl = new URL ( 'https://qa.builder.io/api/v1/qwik/page' ) ; qwikUrl . searchParams . set ( 'apiKey' , '5b8073f890b043be81574f96cfd1250b' ) ; qwikUrl . searchParams . set ( 'userAttributes.urlPath' , location . pathname ) ; const response = await fetch ( String ( qwikUrl ) ) ; const { html } = await response . json ( ) ; document . querySelector ( '#my-content' ) ! . innerHTML = html ; } ;