Search

Results include substring matches and semantically similar vals. Learn more
rozek avatar
GDI_ClientInfoService
@rozek
This val is part of a series of examples to introduce "val.town" in my computer science course at Stuttgart University of Applied Sciences . The idea is to motivate even first-semester students not to wait but to put their ideas into practice from the very beginning and implement web apps with frontend and backend. It contains a simple HTTP end point which accepts any kind of HTTP request and responds with a JSON Structure containing some interesting details about the client and its request. This val is the companion of https://rozek-gdi_clientinfo.web.val.run/ which contains the browser part (aka "frontend") for this example. The code was created using Townie - with only a few small manual corrections. This val is licensed under the MIT License.
HTTP
responds with a JSON Structure containing some interesting details about the
client and its request.
This val is the companion of
[https://rozek-gdi_clientinfo.web.val.run/](https://rozek-gdi_clientinfo.web.val.run/)
which contains the browser part (aka "frontend") for this example.
natsa avatar
genuineBrownErmine
@natsa
@jsxImportSource https://esm.sh/react
HTTP
/** @jsxImportSource https://esm.sh/react */
import React, { useState, useEffect } from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";
function NodeJSLearningTodoList() {
return <NodeJSLearningTodoList />;
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
joebitcoinorg avatar
sublimeCrimsonReindeer
@joebitcoinorg
@jsxImportSource https://esm.sh/react
HTTP
/** @jsxImportSource https://esm.sh/react **/
import { renderToString } from "https://esm.sh/react-dom@18/server";
export default (req: Request) => {
return new Response(
suman2005 avatar
superRedMoth
@suman2005
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
/** @jsxImportSource https://esm.sh/react@18.2.0 **/
import { renderToString } from "https://esm.sh/react-dom@18.2.0/server";
export default (req: Request) => {
return new Response(
vawogbemi avatar
whoIsHiringHome
@vawogbemi
@jsxImportSource https://esm.sh/react
Script
/** @jsxImportSource https://esm.sh/react */
import { Dispatch } from "https://esm.sh/react";
export default function Home(
dispatch: Dispatch<{
bart avatar
vibrantBlushTyrannosaurus
@bart
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
/** @jsxImportSource https://esm.sh/react@18.2.0 **/
import { renderToString } from "https://esm.sh/react-dom@18.2.0/server";
export default (req: Request) => {
return new Response(
taufiq avatar
aHandler
@taufiq
An interactive, runnable TypeScript val by taufiq
HTTP
import { reactExample } from "https://esm.town/v/stevekrouse/reactExample?v=0";
import { aFunction } from "https://esm.town/v/taufiq/aFunction";
export async function aHandler(request: Request): Promise<Response> {
return reactExample();
dhvanil avatar
web_nJav3rHQoT
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
const explosion = document.createElement('div');
explosion.className = 'explosion';
explosion.style.left = e.clientX + 'px';
explosion.style.top = e.clientY + 'px';
explosion.style.width = '100px';
explosion.style.height = '100px';
lchtao26 avatar
rssProxy
@lchtao26
@jsxImportSource https://esm.sh/preact
HTTP
/** @jsxImportSource https://esm.sh/preact */
import { fetch } from "https://esm.town/v/std/fetch";
import { render } from "npm:preact-render-to-string";
const getFeedUrl = (request: Request) => {
const search = new URL(request.url).searchParams;
stevekrouse avatar
pixel
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Express (deprecated)
query: req.query,
path: req.path,
ip: req.get("true-client-ip"),
userAgent: req.get("user-agent"),
pixelData.push(data);
g avatar
csvViewer
@g
client side csv viewer
HTTP
client side csv viewer
* This application creates a CSV viewer using a Hono app that serves a client-side application.
* It allows users to upload a CSV file, view its contents in a table format, and provides basic sorting functionality.
* The approach:
* 1. Create a server-side Hono app to handle file uploads and serve the HTML, CSS, and JavaScript.
* 2. Implement client-side JavaScript to handle file reading, parsing CSV, and displaying the data in a table.
* 3. Add sorting functionality to allow users to sort the table by clicking on column headers.
* Libraries used:
* - Hono for the server-side application
* - Papa Parse (via esm.sh) for parsing CSV on the client-side
import { serve } from 'https://esm.town/v/g/serveUtils';
postpostscript avatar
blog
@postpostscript
@postpostscript 's Val Town Blog Blog Posts: Ideas 2024-03-06 - Auth for Val Town 2024-03-09 - sqliteUniverse: Make SQLite Queries Against Multiple Endpoints in Deno (Val Town) (Part 1) 2024-03-09 - sqliteUniverse: Make SQLite Queries Against Multiple Endpoints in Deno (Val Town) (Part 2) Other Projects: 2024-02-25 - moduleHighlightValueLink: Link to a Val With a Value or Method's Code Highlighted 2024-02-28 - provideBlob: Return Response Quickly and Poll for the Expensive Parts 2024-03-02 - MyFooter: my footer component which shares random vals I've liked! 2024-03-16 - readmeManager: Edit Val Readmes With Persistent Drafts 2024-04-09 - reactiveStateBlob: wrap blob state in a proxy to autosave it on changes 2024-04-24 - lock: lock that releases when it leaves the execution context 2024-04-25 - fetchWorker: communicate with a worker over a fetch-like interface 2024-01-06 - interruptibleChain: simple interface for pausing and resuming execution chains (now at https://github.com/postpostscript/chain) 2024-01-07 - expiringBlob: create-and-forget blobs using UUIDv7
HTTP
- [2024-03-16 - readmeManager: Edit Val Readmes With Persistent Drafts](https://val.town/v/postpostscript/readmeManager)
- [2024-04-09 - reactiveStateBlob: wrap blob state in a proxy to autosave it on changes](https://val.town/v/postpostscript/re
- [2024-04-24 - lock: lock that releases when it leaves the execution context](https://val.town/v/postpostscript/lock)
park avatar
btc
@park
@jsxImportSource https://esm.sh/react
HTTP
/** @jsxImportSource https://esm.sh/react */
import { useEffect, useState } from "https://esm.sh/react";
import { renderToString } from "npm:react-dom/server";
const CONFIG = {
broken666hearted avatar
Flappybirds
@broken666hearted
@jsxImportSource https://esm.sh/react
HTTP
/** @jsxImportSource https://esm.sh/react **/
import { renderToString } from "https://esm.sh/react-dom@18/server";
export default (req: Request) => {
return new Response(
yawnxyz avatar
SidebarToArchive
@yawnxyz
Sidebar.io Archiver Sidebar's been one of my biggest design resources for the last decade. Since sidebar.io's break announcement this morning (https://sidebar.io/break/) I've set out to mess around with using Val.town to archive sidebar. The Google Sheet can be found here: https://docs.google.com/spreadsheets/d/1RghvMfPTR5xvHMAk1pKYuH2pFYYKOJ6bH0LLkHNZiuc/edit?usp=sharing Initially I was just piping data to Google Sheets but that's slow, wasteful and kind of dumb... instead I just wrapped Hono around the code to provide a download the CSV to browser.
HTTP
# Sidebar.io Archiver
Sidebar's been one of my biggest design resources for the last decade. Since sidebar.io's break announcement this morning (ht
The Google Sheet can be found here: https://docs.google.com/spreadsheets/d/1RghvMfPTR5xvHMAk1pKYuH2pFYYKOJ6bH0LLkHNZiuc/edit?
sema.release();
export async function getSidebar(limit = 1, start = 0) {
const gql = {
// console.log('gql:', JSON.stringify(gql));
let results = await fetchJSON(`https://archive.sidebar.io/graphql`, {
method: 'POST',
while (allLinks.length < totalLimit) {
const links = await getSidebar(limit, offset);
allLinks = allLinks.concat(links);
export default app.fetch;
// let links = await getSidebar(500, 618); // Example usage: limit 10, start from 5
// await addLinksToSheet(links);