mirror of
https://github.com/status-im/autobounty.git
synced 2025-01-13 23:35:27 +00:00
config default vars updated
This commit is contained in:
parent
0de33322b4
commit
5b613d0324
4
config/default.js
Normal file
4
config/default.js
Normal file
@ -0,0 +1,4 @@
|
||||
module.exports={
|
||||
webhook: {URLEndpoint: "/autobounty/fund"},
|
||||
bounty: {}
|
||||
}
|
1
config/development.js
Normal file
1
config/development.js
Normal file
@ -0,0 +1 @@
|
||||
module.exports = {}
|
5
config/index.js
Normal file
5
config/index.js
Normal file
@ -0,0 +1,5 @@
|
||||
var _ = require("lodash");
|
||||
var defaults = require("./default.js");
|
||||
var config = require("./" + (process.env.NODE_ENV || "development") + ".js");
|
||||
module.exports = _.merge({}, defaults, config);
|
||||
|
11
index.js
11
index.js
@ -8,13 +8,14 @@
|
||||
* Depends on commiteth version as of 2017-06-10.
|
||||
*/
|
||||
|
||||
const config = require('./config');
|
||||
|
||||
const SignerProvider = require('ethjs-provider-signer');
|
||||
const sign = require('ethjs-signer').sign;
|
||||
const Eth = require('ethjs-query');
|
||||
|
||||
const address = process.env.ADDRESS;
|
||||
const name = process.env.NAME;
|
||||
const webhook_secret = process.env.WEBHOOK_SECRET;
|
||||
|
||||
const provider = new SignerProvider(process.env.NODE, {
|
||||
signTransaction: (rawTx, cb) => cb(null, sign(rawTx, process.env.KEY)),
|
||||
@ -33,11 +34,13 @@ app.use(cors());
|
||||
// Store issue ids and their bounty addresses
|
||||
var issueData = {};
|
||||
|
||||
|
||||
// Receive a POST request at the address specified by an env. var.
|
||||
app.post(`/comment/${webhook_secret}`, jsonParser, function(req, res, next){
|
||||
app.post(`${config.webhook.URLEndpoint}`, jsonParser, function(req, res, next){
|
||||
if (!req.body)
|
||||
return res.sendStatus(400);
|
||||
var commentBody = req.body.comment.body;
|
||||
return res.sendStatus(200)
|
||||
/*var commentBody = req.body.comment.body;
|
||||
var issueId = req.body.issue.id;
|
||||
var namePosition = commentBody.search("@" + name);
|
||||
// Store toAddress from commiteth
|
||||
@ -81,7 +84,7 @@ app.post(`/comment/${webhook_secret}`, jsonParser, function(req, res, next){
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}*/
|
||||
});
|
||||
|
||||
const port = process.env.PORT || 8181
|
||||
|
@ -16,6 +16,7 @@
|
||||
"ethjs-query": "^0.2.4",
|
||||
"ethjs-signer": "^0.1.1",
|
||||
"express": "^4.15.2",
|
||||
"lodash": "^4.17.4",
|
||||
"web3": "^0.18.2"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user