I have such file structure in my node.js app:

  • app
    • models
      • user
      • book
    • controllers
      • user
      • book
    • views
      • user
      • book

I want to make my app modular. How can I interact with book controller from user controller? I know about require(...), but is there any smart way to do it? So my target is to make many modules (user, book, article, news, etc.), and easily on/off any of these without affecting others (like PHP CMS - Joomla, Wordpress, etc.)

Related posts

Recent Viewed