Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add interactive samples in the REST API section #146

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

pomdtr
Copy link
Contributor

@pomdtr pomdtr commented Mar 20, 2024

This makes uses of the vt-playground web components.

image

I found out multiple broken vals while editing the examples, so I updated them.

I would advise to only import fetchJSON in the api examples.
Wrapping the logic in other vals makes a lot of example useless. ex:

import { alias } from "https://esm.town/v/neverstew/alias";

export let aliasExample = alias({ //
  username: "stevekrouse",
});

This example requires you to read the neverstew/alias val, so I converted it to:

import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";

console.log(await fetchJSON("https://api.val.town/v1/alias/stevekrouse"));

@pomdtr pomdtr changed the title add web component in multiple places Add interactive samples in the REST API section Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant