New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chaining app controller path wrong #6

Closed
mytharcher opened this Issue Oct 17, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@mytharcher
Owner

mytharcher commented Oct 17, 2017

When chaining multi express application together, the controller path calculation based on module.parent of node will be wrong.

app1.js

var express = require('express');
var rainbow = require('rainbow');

var app = express();
app.use('/', rainbow({controllers: 'app1/controllers'}));

module.exports = app;

app2.js

var rainbow = require('rainbow');
var app = require('app1');
app.use('/app2', rainbow({controllers: 'app2/controllers'}))

Then when start the app2, the twice rainbow scanning are always on the app2/controllers path. This made the controllers/routers in app1 which required by app2 cannot be initialized.

This issues mostly caused by the module.parant with node module cache.

@mytharcher mytharcher added the bug label Oct 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment