-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Extend server-side rendering by adding Express middleware support #95
Comments
Does this need more work than just a function that take the options, creates the Middleware and returns the |
Yeah. Actually this is super easy to implement. I will thing about a name and get back to you. I will also take a look at the code and try and remember if there was anything additional I wanted to do for this. |
Any news on this issue? |
Sounds like a plan. |
As discussed in astoilkov#95.
Okay not as easy as I thought, it seems I missed some cases while playing with it. The second problem is, that a view registered to the route '/' does not get shown if the app is mounted to something else then '/', e.g.: /* ... */
app.use('/web', blocks.middleware());
/* ... */ the router will calculate wrong routes. |
I will describe the problem in a detail. To make it easier start with an example: // Server side...
var express = require('express');
var blocks = require('blocks');
var MainApp = express();
var SubApp = express();
/* do things and stuff with the main app */
SubApp.use(blocks.middleware(/* options here */));
MainApp.use('/web', subApp);
MainApp.listen(8000); So we have a // the blocks app
var App = blocks.Application({
history: 'pushState'
});
App.View('Home', {
options: {
route: '/'
}
/* ... */
});
App.View('Test', {
options: {
route: '/test'
}
/* ... */
}); If we now fire an request to The My approach is to create a new property What do you think about this aproach? @astoilkov |
Ok. Let's recap to see if I have understood you correctly. You want to transfer the If that's the idea I like it. Correct me if I am wrong. Is that everything we need to do to support a middleware scenario? |
Yeah, that's it basically. I think I can provide a working (and tested) version tomorrow or Friday. |
As discussed in astoilkov#95.
As discussed in astoilkov#95.
As discussed in #92
The text was updated successfully, but these errors were encountered: