I want to do the following, but I don't know if its possible without do it string manipulation in the URL. I want to get some parameter from the url, I have some data that is passed in the post data, but I need to get some information(userID) from the URL:
- I'm using express
- I'm using post method
- My URL is like:
http://www.mydomain.com/api/user/123456/test?v=1.0
I have the following code, to get all post request:
var http = require('http');
var url = require('url') ;
exp.post('*', function(req, res, next) {
var queryObject = url.parse(req.url,true).query; // not working only get in the object the value v=1.0
var parameter = req.param('name'); // get undefined
}
What I'm missing?
Thanks