Added a controller and handler for dumping JSON data from git webhooks

This commit is contained in:
2017-04-14 18:09:32 +02:00
parent 59e56b970e
commit f49d7eaeb4
2 changed files with 19 additions and 8 deletions

10
src/git/gitRepository.js Normal file
View File

@@ -0,0 +1,10 @@
const assert = require('assert');
class GitRepository {
dumpHook(body) {
console.log(body);
}
}
module.exports = GitRepository;

View File

@@ -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 GitRepository = require('src/git/gitRepository');
const gitRepository = new GitRepository();
function dumpHookController(req, res) {
console.log(req);
gitRepository.dumpHook(req.body)
.then(() => {
res.status(200);
})
.catch((error) => {
res.status(500);
})
}
module.exports = dumpHookController;