sampleVanSSRmain.tsx3 matches
34/** load client HTML */
5async function loadClientHtml() {
6// import VanJS framework and App component
7const [{ default: van }, { default: App }] = await Promise.all([
2829/** load client script for App component hydration */
30async function loadClientScript() {
31// import esbuild and plugins
32const [{ build }, { denoPlugins }] = await Promise.all([
49}
5051export default async function fetch(req: Request) {
52try {
53const { pathname } = new URL(req.url);
uuidGeneratorStreammain.tsx1 match
1export default async function fetch(req: Request) {
2const countParam = new URL(req.url).searchParams.get("count");
3if (countParam === null) {
sampleVanIslandmain.tsx1 match
9const appId = "3753aa97-a7cf-41d0-bcf4-0ed59d25cd26";
1011export default function App(props: { van: VanObj }) {
12const { van } = props;
13const {
cors_example_backendmain.tsx1 match
1export default async function(req: Request) {
2const url = new URL(req.url);
3if (url.pathname === "/default") {
react_httpREADME.md1 match
8import react_http from "https://esm.town/v/stevekrouse/react_http?v=6";
910export function App() {
11const [count, setCount] = useState(0);
12return (
clone_my_vals_to_sqlitemain.tsx2 matches
21);`;
2223function valToRow(val) {
24return [
25val.id,
35}
3637async function insertRows(rows) {
38const query =
39sql`INSERT OR REPLACE INTO all_my_vals (id, name, code, version, privacy, public, run_start_at, run_end_at, created_at) VALUES ${
fetch_timeoutmain.tsx1 match
1async function fetchWithTimeout(timeout = 2_000) {
2const abortSignal = AbortSignal.timeout(timeout);
3
val_town_clientmain.tsx1 match
8* @param options.token - API token (if null, no token will be used, if undefined, the token from the environment variable "valtown" will be used)
9*/
10export default function createClient(options: {
11baseUrl?: string;
12token?: string | null | undefined;
5const PERCENT_COVERAGE = 10; // lower is faster, but higher is more accurate
67function getPixelIndex(numToRound) {
8// Each pixel is 4 units long: r,g,b,a
9const remainder = numToRound % 4;
12}
1314export async function getColor(src: string = EXAMPLE_URL): Promise<string> {
15const { default: Jimp } = await import("npm:jimp");
16const image = await Jimp.read(src);
niceSnippetPostmanCodegenmain.tsx15 matches
1export default async function handler(request: Request) {
2if (request.method !== "POST") {
3return Response.json({ message: "This val responds to POST requests." }, { status: 400 });
17}
1819function writeLog(text = "Hello World") {
20console.log(text);
21}
2223function generateSnippet(inputText) {
24console.clear();
25// Frontend protection
88}
8990function genUrlCode(jsonObj) {
91// console.log(jsonObj)
92let url = getUrl(jsonObj);
122}
123124function getUrl(jsonObj) {
125let protocol = jsonObj["protocol"] || "https";
126let host = jsonObj["host"].join(".");
148}
149150function getQueryString(jsonObj) {
151if (jsonObj["query"] === undefined) {
152return null;
171}
172173function genHeaderCode(jsonObj, skipRestProxy = false) {
174// console.log({jsonObj}) // Array of Object
175// discoveryProxy.ContentType = "application/json"
208}
209210function genMethodCode(jsonObj) {
211// console.log({jsonObj})
212// Only allowed - GET, POST, PUT, DELETE
220}
221222function genBodyCode(jsonObj) {
223// console.log({jsonObj})
224// console.log(Object.keys(jsonObj).length)
308}
309310function insertNewLine() {
311// https://www.cs.cmu.edu/~pattis/15-1XX/common/handouts/ascii.html
312let enable = true;
318}
319320function findInsideCurly(line) {
321// Check for postman vars
322// https://stackoverflow.com/questions/413071/regex-to-get-string-between-curly-braces
338}
339340function escapeStrings(line) {
341let result = JSON.stringify(line);
342result = line.substring(1);
359}
360361function genTriggerCode() {
362let triggerCode =
363"ASSIGN RestProxy_Response = RestProxy.MakeRestRequest(RestProxy_Url, RestProxy_Body, RestProxy_AcceptType, RestProxy_Method)";
388}
389390function genAuthCode(jsonObj) {
391let authCode = "";
392console.log({ jsonObj });
428}
429430function isRunningInGoogleAppsScript() {
431return typeof ScriptApp !== "undefined";
432}