diff options
| author | Adam Soltys <[email protected]> | 2020-06-17 11:04:18 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-06-17 11:04:18 -0700 |
| commit | 139000e710e7cd5f76bc272fb8940305dc6475f1 (patch) | |
| tree | b5dd5964eb5d5e4fc02d122da8d995d2ae9947e3 /routes/lightning/decode.js | |
| parent | ed0da89c7d98195294ced6d71812183a04e24c76 (diff) | |
| download | coinos-server-139000e710e7cd5f76bc272fb8940305dc6475f1.tar.gz coinos-server-139000e710e7cd5f76bc272fb8940305dc6475f1.zip | |
lnurl channel flow
Diffstat (limited to 'routes/lightning/decode.js')
| -rw-r--r-- | routes/lightning/decode.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/routes/lightning/decode.js b/routes/lightning/decode.js new file mode 100644 index 00000000..b7dba120 --- /dev/null +++ b/routes/lightning/decode.js @@ -0,0 +1,15 @@ +const axios = require('axios'); +const lnurl = require('lnurl'); + +module.exports = async (req, res) => { + let { text } = req.query; + const decoded = lnurl.decode(text); + + try { + let result = await axios.get(decoded); + res.send(result.data); + } catch(e) { + l.error(e.message); + res.status(500).send(e.message); + } +}; |
