Function
ssrApp
(
req: Request,
res: Response,
appName: string,
appDir: string,
manifest: QwikManifest,
)
Source from the content-addressed store, hash-verified
| 295 | } |
| 296 | |
| 297 | async function ssrApp( |
| 298 | req: Request, |
| 299 | res: Response, |
| 300 | appName: string, |
| 301 | appDir: string, |
| 302 | manifest: QwikManifest, |
| 303 | ) { |
| 304 | const ssrPath = join(appDir, "server", "entry.ssr.js"); |
| 305 | const mod = await import(file(ssrPath)); |
| 306 | const render: Render = mod.default ?? mod.render; |
| 307 | |
| 308 | // ssr the document |
| 309 | const base = `/${appName}/build/`; |
| 310 | const url = new URL(`${req.protocol}://${req.hostname}${req.url}`).href; |
| 311 | |
| 312 | const opts: RenderToStreamOptions = { |
| 313 | stream: res, |
| 314 | manifest, |
| 315 | debug: true, |
| 316 | base, |
| 317 | serverData: { |
| 318 | url, |
| 319 | }, |
| 320 | }; |
| 321 | await render(opts); |
| 322 | } |
| 323 | |
| 324 | function startersHomepage(_: Request, res: Response) { |
| 325 | res.set("Content-Type", "text/html; charset=utf-8"); |
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…