Skip to content

A Fly Edge Application for combining a bunch of different backends under one hostname

Notifications You must be signed in to change notification settings

superfly/onehostname

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

One Hostname to Rule them All

This is an example Fly Edge Application for implementing one hostname.

How it works

Backend types are defined in src/backends.js. These create a fetch like function for proxying requests to a specific origin. Each backend type manages the headers it sets, some origin sources expect certain host headers, each needs a different set of x-forwarded-* headers.

Try it out

Install fly, clone this repo, compile typescript, start the server.

$ git clone https://github.com/superfly/onehostname.git
$ cd onehostname
$ npm install
$ npm run

And then visit http://localhost:3000 in your browser. Or http://localhost:3000/heroku/. Or something from here: index.js#L14-L18.

About

A Fly Edge Application for combining a bunch of different backends under one hostname

Resources

Stars

Watchers

Forks

Packages