Skip to content

Commit aa406cf

Browse files
authored
feat: add support for iframely (#51)
1 parent 7f6f640 commit aa406cf

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/lambda/server/server.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,21 @@ function handler(event, context, callback) {
1919
const { panes, markup, query } = event.queryStringParameters;
2020
const host = getHostname(event, context);
2121

22+
const frameSrc = `${host}/embed?${queryString.stringify({
23+
panes,
24+
markup,
25+
query,
26+
})}`;
27+
2228
const oembedSearch = queryString.stringify({
23-
url: `${host}/embed?${queryString.stringify({ panes, markup, query })}`,
29+
url: frameSrc,
2430
format: 'json',
2531
});
2632

27-
const oembedLink = `<link type="application/json+oembed" href="${host}/oembed?${oembedSearch}" title="Testing Playground" />`;
33+
const oembedLink = [
34+
`<link rel="alternate" type="application/json+oembed" href="${host}/oembed?${oembedSearch}" title="Testing Playground" />`,
35+
`<link rel="iframely player" type="text/html" href="${frameSrc}" media="height: 300" />`,
36+
].join('');
2837

2938
let body = indexHtml.replace(
3039
/<(\w+)\s[^>]*type="application\/json\+oembed".*?>/g,

0 commit comments

Comments
 (0)