aboutsummaryrefslogtreecommitdiffstats
path: root/index.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2018-09-16 19:29:11 -0700
committerAdam Soltys <[email protected]>2018-09-16 19:29:14 -0700
commit4352e0816865e84ada0ba88c5e04471030d5c07d (patch)
treea32ee84502adc23559a31da0c6a67a9a0dee0199 /index.js
parent00a5d6a5839c65fcb50b55425e2b86e8a5ad4df5 (diff)
downloadcoinos-server-4352e0816865e84ada0ba88c5e04471030d5c07d.tar.gz
coinos-server-4352e0816865e84ada0ba88c5e04471030d5c07d.zip
endpoints to get channels and peers
Diffstat (limited to 'index.js')
-rw-r--r--index.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/index.js b/index.js
index 5593ddab..595eaaac 100644
--- a/index.js
+++ b/index.js
@@ -16,7 +16,7 @@ import io from 'socket.io'
import jwt from 'jsonwebtoken'
import morgan from 'morgan'
import reverse from 'buffer-reverse'
-import zmq from 'zmq'
+import zmq from 'zeromq'
import config from './config'
@@ -287,6 +287,14 @@ const l = console.log
// res.send('success')
})
+ app.get('/channels', auth, async (req, res) => {
+ return res.send(await lna.listChannels())
+ })
+
+ app.get('/peers', auth, async (req, res) => {
+ return res.send(await lna.listPeers())
+ })
+
app.post('/sendPayment', auth, async (req, res) => {
await req.user.reload()
let hash = req.body.payreq