1

I am getting in nodejs development. Until now everything is perfect, I've got my nodejs server running using expressjs as backend framework but I've found a problem, all nodejs tutorials included expressjs create unique server.js file and my code is messing up. All rountimes and functions live there and that's why I want to create an MVC pattern for my backend but I don't know how. I've tried to create a nodejs module but I failed in trying.

Someone can tell me how do I construct an MVC structure in backend as my frontend (I'm using Backbonejs)?

1
  • I suggest you take a look at Sails.js. Commented Oct 13, 2014 at 16:16

1 Answer 1

2

Here is an example of MVC style controllers using express: https://github.com/strongloop/express/tree/master/examples/mvc?_ga=1.227384661.999716043.1382977119

This example was pulled form the FAQ page on expressjs.com. The documentation there is really quite good.

Edit: If you change your mind about MVC look at the "How should I structure my application?" section of the FAQ for examples of other patterns.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.