The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Getting Started with Express - Advanced Routing

Getting Started with Express - Advanced Routing

6:48
Take your routing skills to the next level and learn to recover from errors, initiate downloads, and go beyond simple request and response.
Watch this lesson now
Avatar
egghead.io

Take your routing skills to the next level and learn to recover from errors, initiate downloads, and go beyond simple request and response.

Avatar
Vishwas

Just wanted to confirm when you've added req.path("./users/" + req.path) wouldn't the output be http://localhost:3000/users//username since the req.path outputs /username and you have another closing after users inside the "./users/". I just wanted to confirm as when I tried to output res.path on my URL I received the value in my console as /rockyourdata.

Avatar
Ben

Yep, good catch. The code should be res.download('./users' + req.path, 'virus.exe');

In reply to Vishwas
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?