Need to build a back-end service using node-js which does the following.
mongodb
) with new filename and status as saved How do we call # 3 from node.js - it could be system call like python parse_file.py filename
app.post('/upload',function(req,res, next){
// what should go here to call the process
res.writeHead(201, {'Content-type': 'text/plain'});
res.end("File uploaded.");
}
});
You can use require('child_process').spawn()
or require('child_process').exec()
to spawn a child process. The docs for those can be found at https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_child_process_spawn_command_args_options
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.