Migrating Deprecated HTTP Vals541 words
request handler, and they’ll be cached between requests: // Expensive initialization or data fetching. const expensiveData = await fetchLargeDataset(); const cache = new Map(); export default async function (req: Request):
Sections
Intentionally caching values for performance!
request handler, and they’ll be cached between requests: // Expensive initialization or data fetching. const expensiveData = await fetchLargeDataset(); const cache = new Map(); export default async function (req: Request):
Runtime146 words
requests. Vals have access to environment variables. The experimental Temporal API is enabled. Included environment. fetch to make HTTP requests. import from npm and https. Custom Types View the custom
Sections
Included environment
Included environment. fetch to make HTTP requests. import from npm and https. Custom Types View the custom types we support
Val Town Docs211 words
Storage Store and retrieve any data OpenAI Use the OpenAI API Email Send emails Proxied Fetch Make requests from anonymous IP addresses API and SDK. You can access Val Town
Sections
Val Town Standard Library
Storage Store and retrieve any data OpenAI Use the OpenAI API Email Send emails Proxied Fetch Make requests from anonymous IP addresses
Permissions966 words
url: "http://localhost:3001/v1/fetch?url=https%3A%2F%2Fuser-secretEndpoint.web.val.run". } By supplying the environment variable in a header, I’m allowed access: With authenticationRun in Val Town ↗ import { fetch } from "https://esm.town/v/std/fetch"; const response = await
Sections
Exposing your vals to the internet
url: "http://localhost:3001/v1/fetch?url=https%3A%2F%2Fuser-secretEndpoint.web.val.run". } By supplying the environment variable in a header, I’m allowed access: With authenticationRun in Val Town ↗ import { fetch } from "https://esm.town/v/std/fetch"; const response = await
Upgrade to Deno633 words
is to make room for the browser-standard Response type that is the result of a fetch request. The following image shows all three types used in parallel: req.body is no
Sections
ExpressJS types moved to express namespace
is to make room for the browser-standard Response type that is the result of a fetch request. The following image shows all three types used in parallel: