fix: added missing code from various LN PRs
This commit is contained in:
parent
3fe3fed203
commit
a3eb44bda2
9 changed files with 241 additions and 509 deletions
20
lib/routes/probeLnRoutes.js
Normal file
20
lib/routes/probeLnRoutes.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
const express = require('express')
|
||||
const router = express.Router()
|
||||
|
||||
const plugins = require('../plugins')
|
||||
const settingsLoader = require('../new-settings-loader')
|
||||
|
||||
function probe (req, res, next) {
|
||||
// TODO: why req.settings is undefined?
|
||||
settingsLoader.loadLatest()
|
||||
.then(settings => {
|
||||
const pi = plugins(settings, req.deviceId)
|
||||
return pi.probeLN('LN', req.body.address)
|
||||
.then(r => res.status(200).send({ hardLimits: r }))
|
||||
.catch(next)
|
||||
})
|
||||
}
|
||||
|
||||
router.get('/', probe)
|
||||
|
||||
module.exports = router
|
||||
Loading…
Add table
Add a link
Reference in a new issue