Ride-The-Lightning-RTL/controllers/lndConfSettings.js

18 lines
474 B
JavaScript
Raw Normal View History

2018-10-02 01:11:28 +02:00
var fs = require('fs');
exports.getLNDSettings = (req, res, next) => {
console.log('Getting LND Conf Settings!');
fs.readFile(req.headers.filepath, function(err, data) {
if (err) {
2018-10-06 01:31:39 +02:00
console.log('Reading Config File Failed!');
2018-10-02 01:11:28 +02:00
res.status(500).json({
2018-10-06 01:31:39 +02:00
message: "Reading Config File Failed!",
2018-10-02 01:11:28 +02:00
error: err
});
} else {
console.log('LND Conf read successfully');
res.status(200).json(data.toString('utf8'));
}
});
};