Go refactor

Refactoring is the process of making your codebase better without changing its behaviour. It improves the way your code is written and it improves the structure. Refactoring makes it easier for future you and others to maintain and extend your code.

Go ahead refactor your code by:

This is not so good:

app.get('/products', function(req, res){
    // lots of code here
});

This is better:

app.get('/products', products.showProducts);