@fly/v8env
TypeScript icon, indicating that this package has built-in type declarations

0.55.2 • Public • Published

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

Dependencies (0)

    Dev Dependencies (12)

    Package Sidebar

    Install

    npm i @fly/v8env

    Weekly Downloads

    52

    Version

    0.55.2

    License

    Apache-2.0

    Unpacked Size

    2.09 MB

    Total Files

    88

    Last publish

    Collaborators

    • jeromegn
    • michaeldwan
    • mrkurt