Commit 11f374b9 authored by 智勇's avatar 智勇
parents 4ed84385 dfe61a72
......@@ -13,8 +13,23 @@ var admin = express(); // the sub app
app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())
var attrs = {
configPath:"config_file",
buildCmd:"command",
gitPath:"git_path",
gitGroup:"gitPathHead",
host:"url",
projectType:"type",
projectAuth:"auth",
projectDesc:"desc",
logName:"log_name",
jarFilePath:"target_path"
}
var attrComs = Object.keys(attrs)
var attrComsArr = [];
for(let i of attrComs){
attrComsArr.push(attrs[i]);
}
admin.get('/get_node_command/:name', function (req, res) {
res.setHeader("Content-Type","application/json");
var str = execSync(`node ./get_project_config.js -name ${req.params.name} -attr config_file/command/gitPathHead`)
......@@ -25,6 +40,20 @@ admin.get('/get_node_command/:name', function (req, res) {
res.send({configPath:config_file,buildCmd:command,gitGroup:gitGroup});
});
admin.get('/get_project_attr/:name', function (req, res) {
res.setHeader("Content-Type","application/json");
var comstr = attrComsArr.join("/");
var str = execSync(`node ./get_project_config.js -name ${req.params.name} -attr ${comstr}`)
var items = String(str).replace(/\n/g,"").split("|");
let rs = {},index = 0;
for(let i of items){
rs[attrComs[index]] = i.replace(/\^/g," ");
index++
}
res.send(rs);
});
admin.post('/add_new_proxy', function (req, res) {
let request = req.body;
var str = String(execSync(`cat ../ngrok/docker_env_name.sh`)).replace(/\n/,"");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment