2
3// https://stevekrouse-rimeExampleUI.express.val.run
4export function rimeExampleUI(req, res) {
5 res.send(
6 `<audio controls src="data:audio/ogg;base64,${rimeExample.audioContent}" />`,
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export function runs({ token, error, source, since, until, offset, limit }: {
5 token: string;
6 error?: boolean;
3import { hnLatestPosts } from "https://esm.town/v/stevekrouse/hnLatestPosts";
4
5export const hnFollowApp = function (authors: string[], tags = ["story", "comment"]) {
6 return async function ({ lastRunAt }) {
7 let posts = await hnLatestPosts({
8 authors,
1export async function shuffle(a) {
2 const { default: shuffle } = await import("npm:lodash");
3 return shuffle(a);
1export const dataToRSS = function (data: Item[], settings: Setting) {
2 let { title, link, description, rssLink } = settings;
3 let rss = [
1// View at https://stevekrouse-expressHTMLExample.express.val.run?name=Steve
2export async function expressHTMLExample(
3 req: express.Request,
4 res: express.Response,
1export async function parseHTML(text) {
2 const { DOMParser } = await import(
3 "https://deno.land/x/deno_dom/deno-dom-wasm.ts"
32 <script src="https://cdn.moderntreasury.com/compliance/v1/mt-onboarding.js"></script>
33 <script type="application/ecmascript">
34 function openIframe() {
35 const onSuccess = function (event) {
36 // handle success event (e.g. move user to the next step of your flow following KYC)
37 };
38
39 const onError = function (event) {
40 // handle error event (e.g. open the iframe again)
41 };
42
43 const onCancel = function (event) {
44 // handle cancel event (e.g. email the user later to try and reactivate them)
45 // note: this event will not be triggered if the user closes their browser.
1export function myApi(name) {
2 return "hi " + name;
3}
1export function testHTML(req: express.Request, res: express.Response) {
2 res.send(
3 "<html lang='en'>" +
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": "*",