<% res.writeHead(200, {'Content-Type': "application/json"}); if (get['t']) { if (get['t'] === "en") { target = "en"; } else { target = "mt"; } } else { res.end(); } if (get['u']) { text = get['u']; if (text.length > 500) { res.end(); } text = text.split("\"").join("''"); } else { res.end(); } aw = JSON.parse(child_process.execSync(`cd /mnt/metranslator-api && node index.js api ${target} "${text}"`).toString()); last = child_process.execSync("cd /mnt/metranslator-api && git log -1 --pretty=format:'%an'") aw["system"]["version"] = aw["system"]["version"] + "-" + fs.readFileSync("/mnt/metranslator-api/.git/refs/heads/trunk").toString().substr(0, 8); aw["system"]["last_author"] = last; aw["call"] = "cd /mnt/metranslator-api && node index.js api {$target} \"{$text}\""; %><%- JSON.stringify(aw); %>