|
@@ -3,14 +3,18 @@ const router = express.Router();
|
|
|
const exec = require('child_process').exec;
|
|
|
|
|
|
router.post('/hi', (req, res) => {
|
|
|
- var yourscript = exec('sh ./server/lib/xfdftool/bin/xfdftool',
|
|
|
+ var command = exec('./server/lib/xfdftool/bin/xfdftool',
|
|
|
(error, stdout, stderr) => {
|
|
|
if (error !== null) {
|
|
|
res.status(500);
|
|
|
res.json({
|
|
|
- error: error,
|
|
|
- stdout: stdout,
|
|
|
- stderr: stderr
|
|
|
+ error_message: stderr
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ res.status(200);
|
|
|
+ res.json({
|
|
|
+ data: stdout,
|
|
|
});
|
|
|
}
|
|
|
});
|