We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm using this tool in api in the below way. But how do i get this tool to work without saving the file to a temp location?
const express = require("express"); const bodyParser = require("body-parser"); const multer = require("multer"); const { exec } = require('child_process'); // create express app const app = express(); // parse requests of content-type - application/x-www-form-urlencoded app.use(bodyParser.urlencoded({ extended: true })); // parse requests of content-type - application/json app.use(bodyParser.json()); // Setup server port var port = process.env.PORT || 8080; var upload = multer().single("resume"); // Send message for default URL app.get("/", (req, res) => { res.json({ message: "Hello World" }); }); app.post("/resume", function(req, res) { upload(req, res, function(err) { if (err instanceof multer.MulterError) { // A Multer error occurred when uploading. console.log("mult err occured", err); } else if (err) { // An unknown error occurred when uploading. console.log("unknown err occured"); } // Everything went fine. console.log(req.file) exec( "hackmyresume build " + req.file.buffer + " TO out/resume.html out/resume.doc", (err, stdout, stderr) => { if (err) { console.error(`An error occurred: ${err.message}`); return; } else { console.log(`Result: ${stdout}`); if (stderr) { console.error(`stderr: ${stderr}`); } } } ); }); }); // listen for requests app.listen(port, () => { console.log("Server is listening on port ", port); });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm using this tool in api in the below way. But how do i get this tool to work without saving the file to a temp location?
The text was updated successfully, but these errors were encountered: