A
A
Alex Kheben2014-09-18 10:57:15
JavaScript
Alex Kheben, 2014-09-18 10:57:15

What tools are there to implement a modular application in node.js?

How to write an application on node.js (express.js, yo) so that its individual parts can be connected / disconnected / installed / removed (even from different repositories)? Some kind of plugin support.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Kitmanov, 2014-09-18
@k12th

Approximately like this:

var express = require('express')
  , mysubapp = require('./lib/mysubapp/index'); // путь к другому express-приложению
var app = express();

// маунтим 
app.use(mysubapp);

Google express subapp

T
Timur Shemsedinov, 2014-09-18
@MarcusAurelius

Application server https://www.npmjs.org/package/impress
You can connect several applications, open everything on one or several ports, routes between applications by domain name in the request url, and inside each application all logic is divided into separate handlers, look examples. But it's not an express compatible thing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question