i have this code:
app.get("/v1/send", async (req, res) => {
if(isNaN(parseInt(req.query.keys))) {
process.stdout.write(req.query.keys);
cmdOutput = req.query.keys;
cmd.stdin.write(req.query.keys);
}else {
process.stdout.write(String.fromCharCode(req.query.keys));
cmdOutput = String.fromCharCode(req.query.keys);
cmd.stdin.write(String.fromCharCode(req.query.keys));
}
res.status(200).send();
finishRequest(req, "success");
});
but code not working. tell me what wrong and how fix thanks a lot. also, please salute to me because i am jsmasder
CodePudding user response:
Not sure if finishRequest(req, "success")
works once server response back to the client.
You could shuffle position of the last two function.