node-restify
node-restify copied to clipboard
req.getPath() problem
Hi, im having a problem with req.getPath , when i call getPath return a not cleaned url . My code: server.get('/users/:username',function);
i expected when i call getPath get "/users" or "/users/username" but i get "/user/rodrigo"
No, req.getPath() returns you the actual RESOURCE-URI (without query string) that was sent. Your /users/:username is a param fill in. So you have req.getPath() is what you actually got, and req.params.username is the value rodrigo.