| 117 | } |
| 118 | |
| 119 | async function render({ page, htmlClasses, head, body }: PageOptions) { |
| 120 | let content = html` |
| 121 | <!doctype html> |
| 122 | <html lang="en" class="${htmlClasses ?? ''}"> |
| 123 | <head> |
| 124 | <meta charset="UTF-8" /> |
| 125 | <meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
| 126 | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| 127 | <title>Document</title> |
| 128 | <script src="/tailwindcss.js"></script> |
| 129 | <style type="text/tailwindcss"> |
| 130 | @theme { |
| 131 | --color-red: #ff0000; |
| 132 | --color-green: #00ff00; |
| 133 | --color-blue: #0000ff; |
| 134 | } |
| 135 | </style> |
| 136 | ${head ?? ''} |
| 137 | </head> |
| 138 | <body> |
| 139 | ${body ?? ''} |
| 140 | </body> |
| 141 | </html> |
| 142 | ` |
| 143 | |
| 144 | router.get( |
| 145 | '/', |
| 146 | defineEventHandler(() => content), |
| 147 | ) |
| 148 | |
| 149 | await page.goto(server.url) |
| 150 | } |
| 151 | |
| 152 | const app = createApp() |
| 153 | const router = createRouter() |