spee.ch/routes/api-routes.js

25 lines
587 B
JavaScript
Raw Normal View History

var path = require('path');
var axios = require('axios');
2017-06-03 09:41:02 +02:00
var lbryApi = require('../helpers/lbryApi.js');
module.exports = function(app){
// route to return claim list in json
app.get("/claim_list/:claim", function(req, res){
var claim = req.params.claim;
// make a call to the daemon
axios.post('http://localhost:5279/lbryapi', {
method: "claim_list",
params: {
name: claim
}
}
).then(function (response) {
console.log("success");
res.send(response.data);
}).catch(function(error){
console.log(error.data);
res.send(error.data);
})
});
}