aboutsummaryrefslogtreecommitdiffstats
path: root/routes/lightning/send.js
blob: ba88aaf60a3411cc3c7dfcedce671eeadd22860f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { err } from "$lib/logging";
import send from "$lib/send";

export default async (req, res) => {
  let { amount, route, memo, payreq } = req.body;
  let { user } = req;

  try {
    res.send(await send(amount, memo, payreq, user));
  } catch (e) {
    console.log(e)
    err(
      "problem sending lightning payment",
      user.username,
      payreq,
      e.message
    );
    res.code(500).send(e.message);
  }
};