1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**
* This val embeds itself in the web page created by hitting it's Web Endpoint!
*/
export let embedSelf = async (request: Request): Promise<Response> => {
return new Response(
`
<style>
:root { background: "white"; font-family: sans-serif; }
</style>
<h1>My cool new val</h1>
<iframe
id="val_embedded"
title="Embedded Val Example"
width="100%"
height="500"
src="https://www.val.town/embed/neverstew.embedSelf"
/>
`,
{ headers: { "Content-Type": "text/html" } },
);
};
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.