Using Promises in Node.js Apps

See the original posting on DZone Python

To separate logic of accessing data from the routes, we create separate modules to handle the task of data access. When I started learning Node.js, a common pattern that I saw in some samples to separate the data access logic from routing was as follows:
Preview Text: 

To separate logic of accessing data from the routes, we create separate modules…