File tree Expand file tree Collapse file tree 1 file changed +17
-13
lines changed
packages/site-server/src/catalog/routes/catalog Expand file tree Collapse file tree 1 file changed +17
-13
lines changed Original file line number Diff line number Diff line change 4
4
* SPDX-License-Identifier: Apache-2.0
5
5
*/
6
6
7
- import Router from '@koa/router' ;
8
- import { renderPage } from '../../../templates/base.js' ;
9
7
import { DefaultContext , DefaultState , ParameterizedContext } from 'koa' ;
8
+ import { html } from 'lit' ;
10
9
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' ;
11
15
12
16
export const handleCatalogRoute = async (
13
17
context : ParameterizedContext <
@@ -16,17 +20,17 @@ export const handleCatalogRoute = async (
16
20
unknown
17
21
>
18
22
) => {
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
+ ) ;
30
34
context . type = 'html' ;
31
35
context . status = 200 ;
32
36
} ;
You can’t perform that action at this time.
0 commit comments