1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const body = `<!doctype html>
<html>
<head>
<title>VT Playground</title>
<script
type="module"
src="https://raw.esm.sh/vt-playground@0.1.7/dist/vt-playground.js"
></script>
</head>
<body>
<h1>Web Component Demo</h1>
<div>
<h2>Inline Code</h2>
<vt-playground code="console.log('Hello, World!');"></vt-playground>
<div>
<div>
<h2>From a Val</h2>
<vt-playground val="pomdtr/vt_playground_demo"></vt-playground>
<div>
</body>
</html>
`;
export default function() {
return new Response(body, {
headers: {
"Content-Type": "text/html",
},
});
}
👆 This is a val. Vals are TypeScript snippets of code, written in the browser and run on our servers. Create scheduled functions, email yourself, and persist small pieces of data — all from the browser.