add webhook gitea

This commit is contained in:
joseph le 2023-09-20 13:12:16 +07:00
parent a3b6695f97
commit 89049b1de8
1 changed files with 25 additions and 0 deletions

View File

@ -202,4 +202,29 @@ router.get("/api/dailyLog", (req, res) => {
console.log(error); console.log(error);
} }
}); });
router.post("/api/gitea-webhook", ( req, res ) => {
// Kiểm tra xem đó có phải sự kiện bạn muốn xử lý không
// if (request.headers['x-gitlab-event'] === 'push') {
// // Lấy dữ liệu sự kiện từ req.body
// const eventData = req.body;
// // Xử lý dữ liệu sự kiện ở đây
// console.log('Received push event from GitLab:');
// console.log(JSON.stringify(eventData, null, 2));
// }
console.log("New event ---> ", req);
// exec(
// Env.get("URL_FILE_SHELL"),
// (error, stdout, stderr) => {
// if (error) {
// console.error(`Error executing command: ${error}`);
// return;
// }
// console.log(`Command output:\n${stdout}`);
// }
// );
});
module.exports = router; module.exports = router;