diff --git a/netmiko_Api/routes/router.js b/netmiko_Api/routes/router.js index a70b888..a19b420 100644 --- a/netmiko_Api/routes/router.js +++ b/netmiko_Api/routes/router.js @@ -202,4 +202,29 @@ router.get("/api/dailyLog", (req, res) => { 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;