Added a controller and handler for dumping JSON data from git webhooks
This commit is contained in:
10
src/git/gitRepository.js
Normal file
10
src/git/gitRepository.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
const assert = require('assert');
|
||||||
|
|
||||||
|
class GitRepository {
|
||||||
|
|
||||||
|
dumpHook(body) {
|
||||||
|
console.log(body);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = GitRepository;
|
||||||
@@ -1,14 +1,15 @@
|
|||||||
/*
|
|
||||||
* @Author: KevinMidboe
|
|
||||||
* @Date: 2017-04-14 17:11:58
|
|
||||||
* @Last Modified by: KevinMidboe
|
|
||||||
* @Last Modified time: 2017-04-14 17:13:40
|
|
||||||
*/
|
|
||||||
|
|
||||||
const configuration = require('src/config/configuration').getInstance();
|
const configuration = require('src/config/configuration').getInstance();
|
||||||
|
const GitRepository = require('src/git/gitRepository');
|
||||||
|
const gitRepository = new GitRepository();
|
||||||
|
|
||||||
function dumpHookController(req, res) {
|
function dumpHookController(req, res) {
|
||||||
console.log(req);
|
gitRepository.dumpHook(req.body)
|
||||||
|
.then(() => {
|
||||||
|
res.status(200);
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
res.status(500);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = dumpHookController;
|
module.exports = dumpHookController;
|
||||||
Reference in New Issue
Block a user