aboutsummaryrefslogtreecommitdiffstats
path: root/src/api.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-06-15 23:46:46 -0700
committerAdam Soltys <[email protected]>2026-06-15 23:46:46 -0700
commitb312abb4432cb3258c896541babd9a31c9aabca9 (patch)
tree66d381d32d1fd61f66b426110b1d4a5fba79c5cd /src/api.js
parenteedba2f7f78b2ed5297a28ee88c70466ff13aa67 (diff)
downloadcoinosv3-b312abb4432cb3258c896541babd9a31c9aabca9.tar.gz
coinosv3-b312abb4432cb3258c896541babd9a31c9aabca9.zip
Add footer; default to public explorers (proxy via localStorage opt-in)
- Footer: "made with ♥ by Adam Soltys" (links adamsoltys.com) and "source available on GitHub" (links the repo). - Explorer endpoint now defaults to the public explorers; a rate-limited machine can opt into a proxy via localStorage('explorer-proxy'). Correct for a hosted multi-user deploy (each visitor uses their own IP). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Diffstat (limited to 'src/api.js')
-rw-r--r--src/api.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/api.js b/src/api.js
index 0135369..a91d94b 100644
--- a/src/api.js
+++ b/src/api.js
@@ -6,9 +6,18 @@
// - a 429 from ANY request immediately backs off ALL subsequent requests
// (global exponential pause), easing back as requests succeed.
-// TEMPORARY: route explorer traffic through a VPS while this IP is rate-limited
-// by mempool.space. Set PROXY = '' to go back to the public explorers directly.
-const PROXY = 'http://51.79.52.200:8088';
+// Explorer endpoint. Defaults to the public explorers (correct for a hosted,
+// multi-user deploy — each visitor uses their own IP). A specific machine whose
+// IP is rate-limited can opt into a proxy at runtime:
+// localStorage.setItem('explorer-proxy', 'http://51.79.52.200:8088')
+// (http proxy only works when the page itself is served over http/localhost).
+const PROXY = (() => {
+ try {
+ return localStorage.getItem('explorer-proxy') || '';
+ } catch {
+ return '';
+ }
+})();
const BACKENDS = PROXY
? {