MVC Express with sub-applications and common templates / views

Node MVC

Good, that's why Im is currently building a Node / Express MVC template for all future projects. Requirements dictate that supporting applications should be supported to help organize the code, and create a separation of problems between different areas of the site, for example. User account section and non-authenticated site area.

My progress can be seen here: https://github.com/tkiddle/expressPlate/tree/tkiddle

So far, Ive created a way to support helper applications and organize controllers for each application.

The current structure looks something like this:

ROOT
 | - server.js
 | - package.json
 | - views
    | - index.jade
 | - apps
    | - admin
        | - models
        | - controllers
        | - views
            | - assets
            | - templates (jade templates)
    | - blog 
        | - models
        | - controllers
        | - views
            | - assets
            | - templates (jade templates)
    | - events 
        | - models
        | - controllers
        | - views
            | - assets
            | - templates (jade templates)

Id , (, ) / (, ). , -, , ROOT- > views .

index.jade ( ROOT- > views), /jade - .

Im . - ?

+4
3

, " " , shared , layouts. shared , , .., layouts , , .. -, -.

, .

0

: sails.js - MVC node.js, . express.js . .

0

. , , jade app.locals.basedir = 'apps', . , jade include/blog/views/templates/blog.jade. , , include/shared/views/mixins/global-header.jade, .

, , . subapps, . , , , , , mixins ..

express, "" , app.use(express.static('/module1/public'), , app.use(express.static('/module2/public'). , . ? , , app.basedir.use('blog/views') , app.basedir.use('events/views'), Jade , include blog-base.jade event-base.jade, .

-1

All Articles