A developer can also create "sub-apps" or modules within a "node app"
using ExpressJS router and module.exports. "Sub-apps" do not have their own
port numbers.
Here's a little bit of trivia; when I click on the link to "expand" this
conversation in Gmail, it leads to a 1.8 Megabyte download. Maybe someone
should start a new thread ;-)
Kelly,
It appears to me that the idea of "sub-apps" in Express.js is a "router"
within a "router". A "sub-app" is NOT an otherwise functional application,
if I understand correctly.
Given the already obscure interface exposed by Express.js, their idea of
"routers" within "routers" or "apps" within "apps" becomes even less clear.
They use regular expressions including wild-card characters to compare
"routes" to URL "paths" which is another difficult concept. There is quite
a bit of "overhead" in matching URLs with regular expressions.
After more thought, I'm still hung-up on the "necessity" of restarting a
Node.js service every time a routing configuration changes, which occurs
with every new "functional application" that is added to the service (every
new URL which is defined). We're adding new applications to our Web portal
daily during "sprints".
The need for an external router which includes fail-over support would be
an absolute requirement. When you combine "applications" with "routing" and
"HTTP services" in a single process, developers come up with all kinds of
unforeseen ways to bring down the entire lot. Maybe it's as simple as a
condition that results in a continuous loop. And it's unclear what may have
caused it.
It appears to me that Node.js is more suited for "simple" "applets".
As an Amazon Associate we earn from qualifying purchases.