1export function Food(x, y) {
2 return { x, y };
3}
1export function hueRotate() {
2 // Generate a random number between 0 and 180
3 let randomNumber = Math.floor(Math.random() * 181);
1export async function handler(req, res) {
2 console.email(JSON.stringify(req.body, null, 4), "Hello from Val.town!");
3}
1// NOT FUNCTIONAL
2// THE PDF LIBRARY PROBABLY WON'T WORK WITH THE CODE AS IT IS
3export const parsePdfData = (req: express.Request, res: express.Response) => {
20 boost: false,
21 query: {
22 function_score: {
23 query: {
24 bool: {
1export function hello(name) {
2 return "hi " + name;
3}
1import { extractValArgs } from "https://esm.town/v/sdan/extractValArgs";
2
3export async function getArgs(valName: string) {
4 const rep = await extractValArgs(valName);
5 return rep;
1export function proj(ll: Pos2): Pos2 {
2 // Arbitrary.
3 const D2R = Math.PI / 180;
1let { untitled_test_state } = await import("https://esm.town/v/stevekrouse/untitled_test_state");
2
3export function untitled_mutate_test_state(newState) {
4 return (untitled_test_state = newState);
5}
4 title: Val Town API
5 description: |
6 The Val Town API provides services to evaluate JavaScript and TypeScript expressions, run vals as APIs, either as functions or Express handlers.
7
8 Learn more at [https://docs.val.town](https://docs.val.town)
35 description: |
36 The JavaScript or TypeScript expression to be evaluated.
37 This should be a single expression, like a single function
38 call, assignment operation, or calculation. If you need
39 to execute multiple expressions, wrap them in a function.
40 schema:
41 type: string
44 value: "1+1"
45 summary: Simple addition
46 functionCall:
47 value: "@stevekrouse.addOne(@stevekrouse.example1)"
48 summary: Calling a user's val function
49 handle:
50 name: handle
71 summary: "id"
72 description: |
73 This val is a function that returns its arguments. It is useful for testing how the API handles the arguments passed to it.
74
75 View the val at [https://val.town/v/stevekrouse.id](https://val.town/v/stevekrouse.id)
92 value: 2
93 summary: Simple addition result
94 functionCall:
95 value: 42
96 summary: Calling a function result
97
98security:
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.