@fly/v8env
v0.55.2
Published
Open source Edge Application runtime
Downloads
426
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/writesfly/data
: a global persistent key/value store for permanent datafly/image
: Image manipulation APIsfly/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