The idea is to move this capability into Keystone core and use a new component routes option in Keystone.init() to configure React routes to enable universal Routing with React in Keystone apps.
However, when I try to move this into Keystone proper, the routes are 404. );
I have verified that keystone.get('component routes') returns the expected object, and I have tried moving the app.use() call up above the application routes config here:
Having a little trouble here.
I got universal routing working with React in the universal-keystone-boilerplate and made a factory that takes react-router-routes and returns an express router.
The idea is to move this capability into Keystone core and use a new
component routes
option inKeystone.init()
to configure React routes to enable universal Routing with React in Keystone apps.However, when I try to move this into Keystone proper, the routes are 404. );
See my component routes fork.
The factory is in createComponentRouter.js.
I'm attempting to use the factory in
createApp.js
:I have verified that
keystone.get('component routes')
returns the expected object, and I have tried moving theapp.use()
call up above the application routes config here:Don't want to waste too much time stuck on this. Any ideas?
Reproduce
To test this, you can clone the universal-keystone-boilerplate and follow the getting started guide.
npm install
andnpm test
to verify that you've got everything set up correctly.The tests on master should pass.
Then check out the
move-component-routing
branch and replace thekeystone
directory innode_modules
with thecomponent-routes
keystone fork.Actual Result
Run the tests in the boilerplate again, and you should see the 404 fails.
Expected Result
All tests should pass.
See also