我想使用url.parse()方法解析我的req.url。但它正在显示
TypeError: Cannot call method 'parse' of undefined
代码:
var url = require('url');
var url_parts = url.parse(req.url, true);
var query = url_parts.query;
req.url值:
/auth/google/callback?state=example+return+string&code=4/FTbL4FcZ5-Lj7cHdb9gdz8GG1zMVdxWw8IzANsowFAA.ciQe3G7mL4YYcp7tdiljKKbTnUsmmAI&authuser=0&num_sessions=1&prompt=consent&session_state=d61f28145e5edbae1580aebbb36aea97a7f07cde..3baf