Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8723261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:35:22+00:00 2026-06-13T07:35:22+00:00

I was impressed by the mini-app concept in the peepcode node.js tutorial . Instead

  • 0

I was impressed by the mini-app concept in the peepcode node.js tutorial. Instead of having global folders:

/site/models
/site/views

you create another level of seperation per application area:

/site/login/models
/site/catalog/models

AFAIU application areas must know nothing on each other. This creates some questions as for where to put shared db models, and if too much shared models imply that the wrong mini-app seperation was made. I’m trying to find more material on this mini-app concept. The webcast mentions that it is common in django. Anyone has experience or material about it in node (preferred) or django?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:35:23+00:00Added an answer on June 13, 2026 at 7:35 am

    I also based my express.js structure on Django. There are two different techniques and they both have limitations and they both aren’t exactly like Django apps.

    I use this api in my app.js file.

    var app = express();
    require('./some-app1').init(app);
    require('./some-app2').init(app);
    

    My sub-app directory:

     some-app
     - index.js
     - middleware.js
    

    This is the same for both techniques.

    Next is the way I use when my app doesn’t need a dedicated views directory.

    index.js

     var middleware = require('./middleware');
    
     var subapp = function (app) {
        app.get('/stuff', middleware.handle_stuff);
     }
    
     module.exports = subapp;
    

    This is how I started out doing things which is really basic but works well.

    For the second technique you need to know that Express actually has something that is called a sub-app. This is a real Express object which you mount on top of a base application.

    index.js

     var app = express();
    
     app.get('/stuff', middleware.handle_stuff);
    
     var subapp = function (app) {
        app.use(app);
     }
    
     module.exports = subapp;
    

    Before picking the first or second technique I mostly just ask myself ‘Do I need a dedicated views directory for this app?’. If the answer is ‘yes’ I’ll go for the second. I’ve seen others use the second technique because the real sub apps can run on their own so you can actually do isolated http request for testing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was watching a tutorial on Rails and was very impressed that you could
I have been trying out a few index views and am impressed but I
Having recently read Growing OO systems guided by tests, I am very impressed with
I am impressed of Node.js but have small problems trying to imagine how I
I was looking at an app screenshot and was impressed with its setting options
Having just downloaded and installed the latest version of Sandcastle I was impressed with
I've always been impressed by the StackOverflow hive mind, and was hoping you could
I am very impressed with the Prototip plug-in, and I was wondering if there
this is my first post here on stackoverflow and am very impressed by the
I'm a new user to knockout.js and so far have been very impressed with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.