Skip to content

Commit a644796

Browse files
committed
WIP
1 parent c8ef898 commit a644796

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

packages/site-server/src/catalog/routes/catalog/catalog-route.ts

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
import Router from '@koa/router';
8-
import {renderPage} from '../../../templates/base.js';
97
import {DefaultContext, DefaultState, ParameterizedContext} from 'koa';
8+
import {html} from 'lit';
109
import {Readable} from 'stream';
10+
import Router from '@koa/router';
11+
import {render} from '@lit-labs/ssr/lib/render-with-global-dom-shim.js';
12+
13+
import '@webcomponents/internal-site-client/lib/entrypoints/catalog.js';
14+
import {renderPage} from '../../../templates/base.js';
1115

1216
export const handleCatalogRoute = async (
1317
context: ParameterizedContext<
@@ -16,17 +20,17 @@ export const handleCatalogRoute = async (
1620
unknown
1721
>
1822
) => {
19-
context.body = Readable.from(renderPage({
20-
title: `Web Components Catalog`,
21-
scripts: [
22-
'/js/catalog.js'
23-
],
24-
content: `
25-
<wco-top-bar></wco-top-bar>
26-
<h1>Catalog</h1>
27-
<wco-catalog-search></wco-catalog-search>
28-
`,
29-
}));
23+
context.body = Readable.from(
24+
renderPage({
25+
title: `Web Components Catalog`,
26+
scripts: ['/js/hydrate.js', '/js/catalog.js'],
27+
content: render(html`
28+
<wco-top-bar></wco-top-bar>
29+
<h1>Catalog</h1>
30+
<wco-catalog-search></wco-catalog-search>
31+
`),
32+
})
33+
);
3034
context.type = 'html';
3135
context.status = 200;
3236
};

0 commit comments

Comments
 (0)