node.js - where to code business logic in nodejs with expressjs, mongoosejs and redis -


my business logic includes mongodb operations , redis operations on 1 request. not know should put logic code to. in java project, have dao, service , controler objects. in nodejs projects, don't know put code. shall put logic code routes/index.js?

app.post('/deal', function(req, res) {     ... //todo: here  }); 

or create kind of service objects such in java proejct?

here's question might help: mongoose-based app architecture

you should @ http://mean.io stack, templates show how best structure app, including store logic.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -