@fly/v8env

Open source Edge Application runtime

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@fly/v8env
972160.55.23 years ago5 years agoMinified + gzip package size for @fly/v8env in KB

Readme

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

For more documentation, check out the Fly runtime API docs here: https://fly.io/docs/apps/api/index.html