https://github.com/fly-apps/fly-replay-js
An example VanillaJS app showing off `fly-replay`
https://github.com/fly-apps/fly-replay-js
Last synced: 4 months ago
JSON representation
An example VanillaJS app showing off `fly-replay`
- Host: GitHub
- URL: https://github.com/fly-apps/fly-replay-js
- Owner: fly-apps
- License: mit
- Created: 2024-06-18T09:48:47.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-16T06:44:38.000Z (almost 2 years ago)
- Last Synced: 2025-03-11T02:51:51.049Z (over 1 year ago)
- Language: Dockerfile
- Size: 18.6 KB
- Stars: 3
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# An example VanillaJS app showing off `fly-replay`
[](https://www.youtube.com/watch?v=riCh9Xeuf0s)
Dynamic Request Routing is a unique Fly.io networking feature that allows re-routing requests to other apps, regions, or machines. To use it, you must put an HTTP `fly-replay` header on a response to the request your app received. Once our proxy receives the response with the `fly-replay` header, it will re-send the request according to the header value - e.g., to another app. It is useful, for example, to implement a multi-region Postgres. `fly-replay` allows for re-routing write requests to the master Postgres node.
How to install flyctl: https://fly.io/docs/flyctl/install/
Dynamic Request Routing: https://fly.io/docs/networking/dynamic-request-routing/
Multi-region databases and `fly-replay`: https://fly.io/docs/blueprints/multi-region-fly-replay/
Multi-tenant apps with single-tenant SQLite databases in global Tigris buckets (relies on the fly-replay): https://fly.io/javascript-journal/single-tenant-sqlite-in-tigris/
Real-Time Collaboration with Replicache and Fly-Replay: https://fly.io/blog/replicache-machines-demo/
Fly.io .internal DNS: https://fly.io/docs/networking/private-networking/
## Steps to run the demo
1. Set up your app names in `fly.v{1,2}.toml`
2. Create the apps: `fly apps create js-replay-v{1,2}`.
3. Deploy the apps: `fly deploy --config fly.v{1,2}.toml`
Check out the video to learn more.