With below code I have created a HTTP server on port 3000 and have added some get parameters. I want to invoke a python script with this express.js server code such that when I hit localhost:3000/key1/abc/key2/234 python script will get invoked. I've my python script ready which takes input args as sys.argv. Please suggest how I call python script with this code so that it will take value1 and value 2 as input arguments.
var express = require('express');
var app = express();
app.get('/key1/:value1/key2/:value2',function(req,res)
{
console.log(req.params);
var value1 = req.params.value1;
var value2 = req.params.value2;
res.send(req.params);
});
app.listen(3000,function()
{
console.log("Server listening on port 3000");
});
via Nikita Gupta
No comments:
Post a Comment