import { resolveClientEntry } from '@mary/dromi/server'; const renderPage = (entryName: string, title: string): Response => { const { entry, js, css } = resolveClientEntry(entryName); const html = ` ${title} ${css.map((href) => ``).join('')} ${js.map((href) => ``).join('')}

${title}

rendered on the server

`; return new Response(html, { headers: { 'content-type': 'text/html; charset=utf-8' } }); }; export default { fetch(request) { const url = new URL(request.url); switch (url.pathname) { case '/': { return renderPage('main', 'home'); } case '/about': { return renderPage('about', 'about'); } } return new Response('not found', { status: 404 }); }, } satisfies Deno.ServeDefaultExport;