This commit is contained in:
dongpd 2020-05-26 10:00:59 +07:00
parent 39de6890b2
commit 462681a1c9
3 changed files with 19 additions and 2 deletions

View File

@ -48,3 +48,18 @@ exports.ReadConfig = async function (req, res) {
}; };
exports.Reset = async function (req, res) {
console.log("Reset " + req.body.path);
const { execSync } = require('child_process');
execSync('sudo systemctl stop S905X_BI');
execSync('sudo systemctl disable S905X_BI');
execSync('rm /root/monitor/setup/engine.json');
if (req.body.path !== "") {
execSync('rm -rf ' + req.body.path);
}
res.send({status:true});
};

View File

@ -13,4 +13,6 @@ module.exports = function (app) {
app.route('/ReadConfig').post(Api.ReadConfig); app.route('/ReadConfig').post(Api.ReadConfig);
app.route('/Reset').post(Api.Reset);
}; };

View File

@ -41,6 +41,6 @@ io.sockets.on('connection', function (socket) {
}); });
}); });
console.log('AIParking API Server Started On Port: ' + port); console.log('BiFace Started On Port: ' + port);
module.exports = app; module.exports = app;