NodeJS解析URL?

时间:2013-12-04 00:54:00

标签: node.js url get

我有一个这样的网址:“http://domain.com/get/token#token_id=3042hab1234h00011h”,我需要从中获取网址和retreive token_id。

我正在使用这样的东西来获取所有路径,然后拆分它:

app.get('/get/token', function (req, res) { 
    var fullURL = req.protocol + "://" + req.get('host') + req.url;
    console.log(fullURL);
});

但结果是:

http://domain.com/get/token

有关如何检索token_id或匹配网址然后拆分它的可能性的任何建议吗?

0 个答案:

没有答案