From f79f84553c4cba1fb371f02d3b456fce556f16e2 Mon Sep 17 00:00:00 2001 From: Center for Creators <101010199+CenterForCreators@users.noreply.github.com> Date: Sat, 11 Oct 2025 18:00:47 -0500 Subject: [PATCH 01/13] Replace app.js with SDK proxy routes + health (Xumm/XRPL) - Serve SDKs from our own domain to avoid IPFS gateway blocks - Added /sdk/xumm.min.js and /sdk/xrpl-latest-min.js routes - Added /health endpoint - Kept single listen() with keep-alive settings --- app.js | 62 +++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/app.js b/app.js index 5ab128e4b4..9326389946 100644 --- a/app.js +++ b/app.js @@ -1,19 +1,32 @@ +// ===== app.js (paste the whole file) ===== +const fetch = global.fetch || ((...a) => import('node-fetch').then(m => m.default(...a))); const express = require("express"); const app = express(); -const port = process.env.PORT || 3001; -app.get("/", (req, res) => res.type('html').send(html)); +/* ---------- SDK ROUTES (served from YOUR domain) ---------- */ +app.get('/sdk/xumm.min.js', async (req, res) => { + const r = await fetch('https://xumm.app/assets/cdn/xumm.min.js'); + const js = await r.text(); + res.type('application/javascript').send(js); +}); -const server = app.listen(port, () => console.log(`Example app listening on port ${port}!`)); +app.get('/sdk/xrpl-latest-min.js', async (req, res) => { + const r = await fetch('https://cdnjs.cloudflare.com/ajax/libs/xrpl/2.11.0/xrpl-latest-min.js'); + const js = await r.text(); + res.type('application/javascript').send(js); +}); -server.keepAliveTimeout = 120 * 1000; -server.headersTimeout = 120 * 1000; +/* ---------- HEALTH CHECK ---------- */ +app.get('/health', (_req, res) => res.json({ ok: true })); +/* ---------- ROOT PAGE (Render demo HTML) ---------- */ const html = `
+Claim 10 CFC once every 24 hours.
+ + +Get updates from CenterForCreators.com
+