aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbun.lockbbin209762 -> 209762 bytes
-rw-r--r--routes/nostr.ts6
2 files changed, 6 insertions, 0 deletions
diff --git a/bun.lockb b/bun.lockb
index acb87c96..480a5a31 100755
--- a/bun.lockb
+++ b/bun.lockb
Binary files differ
diff --git a/routes/nostr.ts b/routes/nostr.ts
index 2b47b834..f1b6a585 100644
--- a/routes/nostr.ts
+++ b/routes/nostr.ts
@@ -265,6 +265,7 @@ export default {
},
async zap(req, res) {
+ try {
const { event } = req.body;
const amount = event.tags.find((t) => t[0] === "amount")[1];
const pubkey = event.tags.find((t) => t[0] === "p")[1];
@@ -273,8 +274,13 @@ export default {
const url = new URL(callback);
url.searchParams.set("amount", (amount * 1000).toString());
url.searchParams.set("nostr", JSON.stringify(event));
+ console.log("URL", url.toString());
const json = await got(url.toString()).json();
res.send(json);
+ } catch(e) {
+ console.log(e);
+ bail(res, e.message);
+ }
},
};