Skip to content
A set of useful libraries for Edge Apps. Run locally, write tests, and integrate it into your deployment process. Move fast and maybe don't break things? Because, gosh darnit, you're an adult.
Branch: master
Clone or download
Latest commit 1bca4f9 Apr 10, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode allow formatting Dec 18, 2018
docs docs + config support for proxy retries Jan 22, 2019
examples/getting-started fix: getting started sending wrong host header (fixes: #34) Jan 24, 2019
scripts/ci feat: AWS S3 backend (#22) Jan 15, 2019
src feat: allow tls options on proxy builder Apr 10, 2019
test feat: firebase backend (#42) Mar 14, 2019
.fly.secrets.yml feat: AWS S3 backend (#22) Jan 15, 2019
.fly.yml feat: Automatically serve webp images when possible (#17) Jan 16, 2019
.gitignore fix: getting started sending wrong host header (fixes: #34) Jan 24, 2019 chore(release): 0.8.0 Apr 10, 2019 new repo name Mar 12, 2019
index.ts feat: Automatically serve webp images when possible (#17) Jan 16, 2019
package.json chore(release): 0.8.0 Apr 10, 2019
tsconfig.json feat: Automatically serve webp images when possible (#17) Jan 16, 2019
yarn.lock fix: faster installs, fly now a dev dependency Apr 4, 2019

Forking Edge

Fly Edge

npm version isc license Build Status Gitter

The Fly Edge project is a set of APIs for routing HTTP traffic, cache content, and add "middleware" (like auth) to any application. It's written in TypeScript and runs on the Fly Edge runtime. It's built for developers — that means runs locally, has a tests, and integrate into a CI/release pipeline.

The code targets the Service Worker API and uses the Fly runtime API where necessary. You can deploy it to hosting or run it on any platform with an Edge Service Worker implementation (with reduced features).

Getting Started


Try the starter app

git clone forking-edge
cd forking-edge
yarn install
yarn start # visit http://localhost:3000

Once you have that running, try swapping in a different origin. Edit index.ts and and replace backends.origin("") with backends.githubPages("superfly/landing").

Deploy to production

You can deploy edge apps to the Fly hosting service using the CLI. Sign up at, then run:

yarn fly login
yarn fly app create <name-of-your-app>
yarn fly deploy

You can also run on CloudFlare or StackPath, though not all features will work.


Straightforward TypeScript/ JavaScript API

You can do a lot with a single index.ts file. This example redirects all requests to https and caches content when possible:

import { backends, middleware, pipeline } from "@fly/edge";

// user middleware for https redirect and caching
const mw = pipeline(

// point it at the origin
const app = mw(

// respond to http requests


Backends are origin services you can route requests to. The project includes a backend type any HTTP service, and more specialized types for proxying to third party services.

Want to help out? Write a new backend type and open a pull request!


Middleware applies logic to requests before they're sent to the backend, and responses before they're sent to users.



Configuration vs code

The Fly Edge can be run standalone with a yaml based configuration schema. If you prefer to run with a config file, check out the config README.

Who's using it?

  • HTTP routing
  • custom domain routing
  • CDN for paid customers
  • routing, caching, redirect management
  • routing, caching, redirect management
  • custom domain routing
  • custom domain routing
  • custom domain routing

You can’t perform that action at this time.