Changeset 36333 for other-projects
- Timestamp:
- 2022-07-29T00:26:00+12:00 (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/bib-stinky/trunk/nodejs-server/express-web-server.js
r36329 r36333 22 22 23 23 app.get("/", (req, res) => { 24 //res.send('Hello World!')25 //res.json({ message: "Test JSON message" });26 24 res.redirect("/index.html"); 27 25 }); 28 26 29 27 30 app.get("/python-test", (req, res) => { 28 app.get("/api/get-doi", (req, res) => { 29 var doi = req.query.doi; 31 30 32 31 var dataToSend; 33 32 34 33 // Spawn new child process to call the python script 35 const python = spawn('python3', [' script1.py']);34 const python = spawn('python3', ['doi-stinky/oacore-get-doi.py', doi, "oacore-output.json"]); 36 35 37 36 // Collect data from script … … 44 43 python.on('close', (code) => { 45 44 console.log(`child process close all stdio with code ${code}`); 46 47 res.send(dataToSend) 45 46 //res.send(dataToSend) 47 res.sendFile("oacore-output.json", { root: __dirname }); 48 48 }); 49 49 });
Note:
See TracChangeset
for help on using the changeset viewer.