Options
All
  • Public
  • Public/Protected
  • All
Menu

@fly/v8env

Fly Standard Library

These are API docs for the Fly runtime JavaScript environment. The runtime implements portions of standard web APIs (like fetch), and additional APIs for doing Fly specific operations.

Basic app

fly.http.respondWith(function(request){
  return new Response("Hello! We support whirled peas.", { status: 200})
})
// if you'd prefer to be service worker compatibility, this is also supported:
// around addEventListener('fetch', function(event){})

fetch function

The fetch function is available within Fly apps for making HTTP requests.

fly.http.respondWith(async function(req){
  const resp = await fetch("http://example.com")
  resp.headers.set("fly-ified", "darn tootin'")
  return resp
})

It's an enhanced version of the standard Web API fetch function.

Primary APIs

  • fly/cache: a regional, in memory cache for low latency reads/writes
  • fly/data: a global persistent key/value store for permanent data
  • fly/image: Image manipulation APIs
  • fly/fetch: libraries for routing and proxying fetch requests

Generated using TypeDoc