Download services/wallet/src/index.ts from AnthropicallyHuggingFaces/ProjectOS: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/spaces/AnthropicallyHuggingFaces/ProjectOS/resolve/main/services/wallet/src/index.ts
- Command line
-
hf download hf://spaces/AnthropicallyHuggingFaces/ProjectOS/services/wallet/src/index.ts
-
curl -L -o index.ts https://huggingface.co/spaces/AnthropicallyHuggingFaces/ProjectOS/resolve/main/services/wallet/src/index.ts
1.23 kB
| import { loadConfig } from "./config.js"; | |
| import { buildApp } from "./app.js"; | |
| import { HfSecretsPersister, Runtime } from "./runtime.js"; | |
| // If WALLET_STORE=supabase is set but the keys are missing/removed, run in memory mode instead of crash-looping. | |
| if (process.env.WALLET_STORE === "supabase" && (!process.env.SUPABASE_URL || !process.env.SUPABASE_SERVICE_ROLE_KEY)) { | |
| console.warn("WALLET_STORE=supabase but Supabase URL/key missing: falling back to memory store"); | |
| process.env.WALLET_STORE = "memory"; | |
| } | |
| const cfg = loadConfig(); // throws on sk_live_ / Apple Pay creds | |
| const persister = new HfSecretsPersister(process.env.SPACE_ID, process.env.HF_SPACE_TOKEN); | |
| const runtime = new Runtime(cfg, { persister }); | |
| const app = buildApp(cfg, null, null, { runtime, adminPasscode: process.env.ADMIN_PASSCODE }); | |
| if (!cfg.STRIPE_SECRET_KEY || !cfg.STRIPE_WEBHOOK_SECRET) console.warn("Stripe not configured: funding/webhook routes return 503 until keys are added on /settings"); | |
| if (!process.env.ADMIN_PASSCODE) console.warn("ADMIN_PASSCODE not set: /settings and /devices sign-in are disabled"); | |
| app.listen(cfg.PORT, "0.0.0.0", () => console.log(`wallet (TEST mode, store=${runtime.storeMode}) listening on :${cfg.PORT}`)); | |