Skip to content

Commit

Permalink
Add initial vt-playground using esm.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmcd committed Apr 4, 2024
1 parent fcc829d commit 3f6d556
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
8 changes: 8 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ export default defineConfig({
defer: true,
},
},
{
tag: "script",
attrs: {
src: "https://raw.esm.sh/vt-playground@latest/dist/vt-playground.js",
defer: true,
type: "module",
},
},
{
tag: "link",
attrs: {
Expand Down
3 changes: 2 additions & 1 deletion src/content/docs/types/http/basic-examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ We can grab query parameters using the web standard [URLSearchParams](https://de
You can also get the body of POST requests using the Request object,
for example if you had an endpoint that received JSON:

<Val url="https://www.val.town/embed/tmcw/jsonBodyParsing" />
<Val url="https://www.val.town/embed/tmcw/jsonBodyParsing" />

4 changes: 3 additions & 1 deletion src/content/docs/types/http/routing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,6 @@ const client = createClient<typeof router>({
const response = await client["/greetings"].get();
const greetings = await response.json();
console.log(greetings);
```
```

<vt-playground id="playground" val="maxm/fetsClientExample"></vt-playground>

0 comments on commit 3f6d556

Please sign in to comment.