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 6945175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:24:08+00:00 2026-05-27T13:24:08+00:00

I have several apps that I’m trying to merge into a single suite: 2

  • 0

I have several apps that I’m trying to merge into a single “suite”: 2 apps are standalone, one is simply an auth layer (using everyauth for FB Connect). I want to set it up like so:

  • / – (home) list of the apps
  • /auth – login for any app
  • /app1 – requires login via /auth to access
  • /app2 – (same)

I’ve considered leaving app1 and app2 standalone, with the top layer being a proxy, but I think it would be hard to share an auth system between them.
Virtualhosts (via Connect) might work, but I don’t necessarily want a DNS’d subdomain for each one.
So instead I’d like to primary app to be the auth layer, and the others “mounted” into that one, with basepath set on each app to a sub-path. (basepath is mentioned in the express Guide but not documented well.)

They all use MongoDB, the auth layer uses connect-mongodb for sessions, so I’m hoping they’ll be able to share the whole auth/session layer between them.

In another thread, “How to share sessions in mounted express apps”, Stephen writes,

I have a fairly complex express based web application that is split up into a few sub apps which are also express apps (using app.use()) …

So how does one use app.use() to mount a sub-app? I was simply trying to use var subApp = require('./subapp/app.js'), with listen() running only in the sub-app when ! module.parent (so not as a sub-app)… but that seems to load all the sub-app’s paths straight into the parent app. I’ve tried setting basepath using app.set('basepath', '/subapp/'), app.basepath = '/subapp/', etc, both in the sub-app itself and from the parent app, but it doesn’t seem to have any effect.

Mounting apps like this makes express incredibly flexible, but it’s not clear how to do it… any advice would be extremely welcome!! (And I’m happy to share lessons from my everyauth implementation if anyone is struggling with that.)

  • 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-05-27T13:24:08+00:00Added an answer on May 27, 2026 at 1:24 pm

    app.use(uri, instanceOfExpressServer)

    Just make sure you don’t call .listen on it.

    The alternative is to use require("cluster") and invoke all your apps in a single master so that they share the same port. Then just get the routing to “just work”

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

Sidebar

Related Questions

I have several apps that need to create and write to Performance Counters. One
I have seen several apps that make use of a UISplitViewController inside a tab.
I have several applications that are part of a suite of tools that various
We have several apps that run on a Windows 2003/2008 server. Some of these
I've built several apps in rails that have submissions that you can vote on.
I'm trying to reproduce a feature I've seen on several apps: I have a
I have several apps that I work on and like to distribute to friends
I have several WPF apps, and I want users to be able to log
I have a number of web apps running on several IIS6/Server 2003 boxes. They
I have several RequiredFieldValidators in an ASP.NET 1.1 web application that are firing on

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.