Building a scalable Node.js Express app
Gerard Rovira

Nice article, one thing I’m missing though in your final result is where do you validate the username from the request, what do you replace this part with ?

if (username === '') {
ack ({ error: 'Username can\'t be blank' });

From what I can see your controller handler is calling the getUser function passing username as the parameter. But it doesn’t seems to validate that this string isn’t empty anywhere, like you were doing before. Am I missing something? Just wondering where the validation for request params should happen.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.