-
Notifications
You must be signed in to change notification settings - Fork 38
Doesn't work, doesn't load a page. A browser just freezes in the middle of a request. #42
Comments
Hey @wzup, you don't need to use config.json {
"middleware": {
"router": {
"module": {
"arguments": [{
"routes": [
{ "path": "/", "method": "GET", "handler": "require:./controllers/index" },
{ "path": "/foo", "method": "GET", "handler": "require:./controllers/foo" }
]
}]
}
}
} or in code: // index.js
// ...
options = {
onconfig: function (config, next) {
//any config setup/overrides here
db.config(config.get('databaseConfig'));
config.set('middleware:router:module:arguments', [{
routes: [
{ path: '/', method: 'GET', handler: require('./controllers/index') },
{ path: '/foo', method: 'GET', handler: require('./controllers/foo') }
]
}]);
next(null, config);
}
},
// ... I just tested with both configurations and they worked without issue. |
Unfortunately, it doesn't work. I must commit that the issue still for some reason remains. I did as you wrote in your answer in a brand new krakenjs application. And when I do page reload http://localhost:8000/ the browser just freezes - it tries to load the page but cannot finish it. Then after some time I get chrome error page and it says I'm on Windows 7 64bit if it matters. |
This is now on a completely freshly generated app? |
@aredridel Yes, on a completely freshly generated app. Here are my steps:
to this:
And a browser freezes. I shows that a page is loading and then an error page with Here are versions of Express and Kraken:
|
And what version of |
Output of |
|
I can confirm that the configuration you're describing does indeed work with vanilla express-enrouten. An example project is in the routes-example, which I created to isolate and verify kraken-js and express-enrouten. Feel free to clone, npm install and start the app. If the generator is creating a configuration that prevents this type of project/routing from working, this issue should be moved to that repo. Additionally, it's not clear what you changed after my initial reply. In your recap of what you did you mentioned starting mongo, which is unnecessary for a freshly generated kraken app. Did you completely remove your original index.js file and start fresh? |
Also, I apologize, I missed one point. Please try that app on your Windows machine. I was only able to test on OS X. |
I've just tested
In a freshly generated krakenjs app I didn't change anything except So, it seems that there is some conflict with the generator. I'll try to find out what it is ) Thank you all. |
Hey @wzup, I've opened an issue on your behalf: krakenjs/generator-kraken#109. Let's track progress over there. |
related to #42 related to krakenjs/generator-kraken#109
Where may I read more about configuration syntax and rules? I mean these. How do you know how to write it:
|
Configuration is handled by confit. That particular config corresponds to this line which you can find in {
"middleware": {
"router": {
"module": {
"arguments": "THIS RIGHT HERE"
}
}
}
} Written out, that line basically says to change the arguments passed to the router middleware to You can accomplish the same thing by just changing the |
The module doesn't allow to load a page. When I enable it as writtent in your manual it doesn't load a page. The browser just freezes in the middle of the request. No errors, no any additional info, just freezes. Here's my
index.js
of akrakenjs
application. No any other alternations of the defaultkraken.js
app is made:Please write how to configure this module right way. You didin't provide enough info. It doesn't work if you include it in your code as written in your manual.
The text was updated successfully, but these errors were encountered: