https://github.com/superfly/onehostname
A Fly Edge Application for combining a bunch of different backends under one hostname
https://github.com/superfly/onehostname
Last synced: about 1 month ago
JSON representation
A Fly Edge Application for combining a bunch of different backends under one hostname
- Host: GitHub
- URL: https://github.com/superfly/onehostname
- Owner: superfly
- Created: 2018-03-13T13:51:04.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-06-14T16:50:50.000Z (almost 7 years ago)
- Last Synced: 2024-10-31T17:44:57.525Z (7 months ago)
- Language: TypeScript
- Size: 30.3 KB
- Stars: 18
- Watchers: 5
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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](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.
```bash
$ 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](index.js#L14-L18).