Sunday, 25 August 2013

where to code business logic in nodejs with expressjs, mongoosejs and redis

where to code business logic in nodejs with expressjs, mongoosejs and redis

My business logic includes mongodb operations and redis operations on one
request. I do not know where we should put logic code to. In Java project,
we have DAO, service and controler objects. but in nodejs projects, I
don't know where to put my code. shall I put logic code to
routes/index.js?
app.post('/deal', function(req, res) {
... //TODO: here
});
or create a kind of service objects such as what we do in Java proejct?

No comments:

Post a Comment