3// we can make it interactive with additional scripts.
4
5export default async function(req: Request): Promise<Response> {
6 const url = new URL(req.url);
7 const pathname = url.pathname;
20}
21
22function serveHomePage(): Response {
23 const htmlContent = `
24<!DOCTYPE html>
68}
69
70function serveStoryPage(title: string, content: string): Response {
71 const htmlContent = `
72<!DOCTYPE html>
2// It now has clickable titles that will serve pages with some fake story content.
3
4export default async function(req: Request): Promise<Response> {
5 const url = new URL(req.url);
6 const path = url.pathname;
2// Titles are clickable and lead to a page with fake story content.
3
4export default async function(req: Request): Promise<Response> {
5 const url = new URL(req.url);
6 const pathname = url.pathname;
3// we can make it interactive with additional scripts.
4
5export default async function(req: Request): Promise<Response> {
6 const htmlContent = `
7<!DOCTYPE html>
3// we can make it interactive with additional scripts.
4
5export default async function(req: Request): Promise<Response> {
6 const htmlContent = `
7<!DOCTYPE html>
3// we can make it interactive with additional scripts.
4
5export default async function(req: Request): Promise<Response> {
6 const htmlContent = `
7<!DOCTYPE html>
3// we can make it interactive with additional scripts.
4
5export default async function(req: Request): Promise<Response> {
6 const htmlContent = `
7<!DOCTYPE html>
5 */
6
7export default async function(req: Request): Promise<Response> {
8 const htmlContent = `
9 <!DOCTYPE html>
4 */
5
6export default async function main(req: Request): Promise<Response> {
7 // Define some example stories
8 const stories = [
3// we can make it interactive with additional scripts.
4
5export default async function(req: Request): Promise<Response> {
6 const htmlContent = `
7<!DOCTYPE html>
A helper function to build a file's email
Simple functional CSS library for Val Town
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": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.