4// TODO: Convert to sqlite
5
6export default async function(req: Request): Promise<Response> {
7 const result = await sqlite.execute(
8 "SELECT COUNT(*) FROM counter_2_baby",
29}
30
31export function createVal({ token, ...data }: { token?: string } & CreateValArgs): Promise<ValResponse> {
32 return fetchJSON("https://api.val.town/v1/vals", {
33 bearer: token || Deno.env.get("valtown"),
40
41export const middleware = (importMetaURL: string) =>
42 async function(req: Request): Promise<Response> {
43 const { author, name } = extractValInfo(importMetaURL);
44 const valURL = `https://www.val.town/v/${author}/${name}`;
12};
13
14export default async function(req: Request) {
15 return new Response(
16 renderToString(
4import { render } from "npm:preact-render-to-string";
5
6function handler(req: Request): Promise<Response> {
7 const body = render(
8 <div>
2import React from "npm:react";
3
4export default function CodeIcon(props: React.SVGProps<SVGSVGElement>) {
5 return (
6 <svg
8Plain, brutalist, no bloat chess. Every page is only html and css. Every chess move is made by clicking a link. Send a link to your friend and they'll send you one back to make your move. No silly animations or slick interactivity to trip up your gameplay. When Google indexes this site will we successfully compute all possible chess moves?
9
10Functionality is quite limited, and things might be broken. Please let me know if you find bugs!
11
12Inspired by [this HN discussion](https://news.ycombinator.com/item?id=39456467) about sites that have all possible game states of tic-tac-toe.
6import { frontmatter } from "npm:micromark-extension-frontmatter";
7
8export async function extractFrontmatter(readme: string) {
9 const tree = await fromMarkdown(readme, {
10 extensions: [frontmatter(["yaml"])],
23}
24
25export async function extractValFrontmatter(val: { author: string; name: string }) {
26 const { readme } = await api<{ readme: string }>(`/v1/alias/${val.author}/${val.name}`);
27 return extractFrontmatter(readme);
1/** @jsxImportSource https://esm.sh/hono@latest/jsx */
2
3export default function SignupModal() {
4 return (
5 <div id="signup-modal" className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 animate-fadeIn">
1/** @jsxImportSource https://esm.sh/hono@latest/jsx */
2
3export default function LoginModal() {
4 return (
5 <>
Simple functional CSS library for Val Town
A helper function to build a file's email
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.