-
Notifications
You must be signed in to change notification settings - Fork 38
API usage is little confused #9
Comments
Unfortunately, for now the new API is not compatible with kraken-js. Kraken does some funny things internally that are not inherited by mounted express applications. I have a separate bit of work going on in parallel to clean up kraken-js to fix this compatibility issue, but for now the old API will continue to function as expected. Additionally, kraken-js uses the old API internally, so it should be necessary to use this module directly if you're building a kraken-js app. |
As I said, I use //var app = express();
var app = enrouten({directory: 'controllers'});
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade'); as you can see above, I made express instance via |
@outsideris var app = express();
express.use(enrouten({ ... }); The second line should be The reason for this is that express allow for mounting different instances to service different parts of an application. When we do: var primaryApp = express();
var enroutedApp = enrouten({ config });
primaryApp.use(enroutedApp); We are telling the primaryApp to use Does this help to clarify things a bit? |
Sorry about the @outsideris, I misread your original issue. You are correct, the new API has a bug in which the |
Also, the README has been updated, so thanks for pointing out that issue. The API should be: var express = require('express'),
enrouten = require('express-enrouten');
var app = express();
app.use(enrouten({ ... }); |
Appreciate!!! 👍 |
in
README
but in index.js, another express instance is created. so there are two express instances.
Therfore when I use express-enrouten without kraken, I configure some settings in express app, but the settings doesn't apply in controllers.
I guess the reason it's different instance.
The text was updated successfully, but these errors were encountered: