1export function myApi(name) {
2 return "hi " + name;
3}
1import { REACT_MINIFIED } from "https://esm.town/v/liamdanielduffy/REACT_MINIFIED";
2
3export function REACT_CDN_VAL(req, res) {
4 res.set("Content-Type", "text/javascript");
5 res.send(REACT_MINIFIED);
1export function ping() {
2 return "pong";
3}
1export function myApi(name) {
2 return "hi " + name;
3}
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export async function stockPriceViz(req: Request) {
5 const durations = new Set([1, 5, 15, 30, 60]);
6 const params = new URL(req.url).searchParams;
8 const d = params.get("d");
9 const resData = await fetchJSON(
10 `https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=${symbol}&interval=${d}min&apikey=${process.env.alphaVantage}`,
11 );
12 const data = {
1export function myApi(name) {
2 return "hi " + name;
3}
4import process from "node:process";
5
6export async function emailMeWhenBadAirQuality({ lat, long }: {
7 lat: number;
8 long: number;
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export function getPocket(params) {
4 return fetchJSON("https://getpocket.com/v3/get", {
5 method: "POST",
2
3export const examplePreactWebApp = preactWebApp(
4 function App(
5 { html, req, ...rest }: typeof preactWebApp.props,
6 ) {
1export function myApi(name) {
2 return "hi " + name;
3}
A helper function to build a file's email
Simple functional CSS library for Val Town
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",