fix: added missing code from various LN PRs

This commit is contained in:
Rafael Taranto 2023-10-31 18:27:42 +00:00
parent 3fe3fed203
commit a3eb44bda2
9 changed files with 241 additions and 509 deletions

View 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